• 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账户认证的意思)

  • 相关阅读:
    Jenkins插件开发(一)--环境搭建
    Jenkins插件开发(二)-- HelloWorld
    Jenkins插件开发(三)-- 插件编写
    持续交付——发布可靠软件的系统方法
    python-字典练习
    python-编写认证登录
    nodejs pm2教程(转载)
    PM2实用入门指南
    删除Remote Desktop的连接历史记录
    Vue中如何使用axios发送jsonp跨域验证
  • 原文地址:https://www.cnblogs.com/hzz521/p/9166609.html
Copyright © 2020-2023  润新知