zoukankan      html  css  js  c++  java
  • EFCore Database-first 批处理生成表结构

    ===数据库优先===
    https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell
    https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/scaffolding?tabs=dotnet-core-cli

    生成迁移 bat_Migrations.bat  

    @echo off
    setlocal enabledelayedexpansion
    set gztmp=register
    set gzcontext=RegisterEntitiesContext
    set gzproject=../GZSales.API.Register
    echo 请输入迁移名称
    set /p gzname=
    echo 迁移生成中,请稍后...
    dotnet ef migrations add %gzname%%gztmp% --context %gzcontext% --project "%gzproject%" --startup-project "../GZSales.API.Start"
    pause

    刷新模型:bat_refreshModel

    dotnet ef dbcontext scaffold Name=ConnectionStrings.GZNETCore.Developer Microsoft.EntityFrameworkCore.SqlServer --output-dir "Tables" --table "data_register_product" --table "data_register_EzCadTools" --use-database-names --force --data-annotations --context "_RegisterEntitiesContext" --project "../GZSales.API.Register" --startup-project "../GZSales.API.Start" 
    
    pause
  • 相关阅读:
    Fiddler基础与HTTP状态码
    Fiddler与F12设置代理
    人和机器猜拳游戏
    ng-model 取不到值
    git的使用
    笔记
    INSPIRED启示录 读书笔记
    INSPIRED启示录 读书笔记
    INSPIRED启示录 读书笔记
    INSPIRED启示录 读书笔记
  • 原文地址:https://www.cnblogs.com/GarsonZhang/p/13943139.html
Copyright © 2011-2022 走看看