zoukankan      html  css  js  c++  java
  • scaffold-dbcontext 命令的使用

    工具的scaffold-dbcontext(数据库上下文脚手架)指令来生成models和context。

    指令详细介绍:

    Scaffold-DbContext [-Connection] <String> [-Provider] <String> [-OutputDir <String>] [-Context <String>]
    [-Schemas <String>] [-Tables <String>] [-DataAnnotations] [-Force] [-Project <String>]
    [-StartupProject <String>] [-Environment <String>] [<CommonParameters>]

    PARAMETERS
    -Connection <String>
    Specifies the connection string of the database.

    -Provider <String>
    Specifies the provider to use. For example, Microsoft.EntityFrameworkCore.SqlServer.

    -OutputDir <String>
    Specifies the directory to use to output the classes. If omitted, the top-level project directory is used.

    -Context <String>
    Specifies the name of the generated DbContext class.

    -Schemas <String>
    Specifies the schemas for which to generate classes.

    -Tables <String>
    Specifies the tables for which to generate classes.

    -DataAnnotations [<SwitchParameter>]
    Use DataAnnotation attributes to configure the model where possible. If omitted, the output code will use only the fluent API.

    -Force [<SwitchParameter>]
    Force scaffolding to overwrite existing files. Otherwise, the code will only proceed if no output files would be overwritten.

    -Project <String>
    Specifies the project to use. If omitted, the default project is used.

    -StartupProject <String>
    Specifies the startup project to use. If omitted, the solution's startup project is used.

    -Environment <String>
    Specifies the environment to use. If omitted, "Development" is used.

    示例:

    Scaffold-DbContext "Server=.;Database=MvcMovie;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force

    Integrated Security(是否集成认证 windows账户认证的意思)

  • 相关阅读:
    我与酷派手机N900+的艰难之旅
    从ASPNET1.1迁移到了ASPNET2.0遇到ORA01000: 超出打开游标的最大数
    彩铃平台接口独立取得阶段性胜利
    中央音乐平台的MD5算法问题
    彩铃接口独立完毕
    'OraOLEDB.Oracle.1' provider is not registered on the local machine.错误的解决
    程序员的陷阱
    ASP NET页面下载程序
    从aspnet1.1升级到aspnet2.0的小问题
    彩铃平台接口的计费服务问题解决
  • 原文地址:https://www.cnblogs.com/hzz521/p/9166609.html
Copyright © 2011-2022 走看看