Scaffold-DbContext 命令参数

本文详细介绍了 Scaffold-DbContext 命令的使用方法,该命令用于从数据库生成 DbContext 和实体类型。文章解释了如何指定数据库连接、提供者、输出目录等参数,并概述了如何使用该命令进行实体框架的代码生成。
NAME
    Scaffold-DbContext
    
SYNOPSIS
    Scaffolds a DbContext and entity types for a database.
    
    
SYNTAX
    Scaffold-DbContext [-Connection]  [-Provider]  [-OutputDir ] [-ContextDir ] [-Context ] [-Schemas <String[]>] [-Tables <String[]>] [-DataAnnotations] 
    [-UseDatabaseNames] [-Force] [-Project ] [-StartupProject ] []
    
    
DESCRIPTION
    Scaffolds a DbContext and entity types for a database.
    

PARAMETERS
    -Connection 
        The connection string to the database.
        
        Required?                    true
        Position?                    1
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Provider 
        The provider to use. (E.g. Microsoft.EntityFrameworkCore.SqlServer)
        
        Required?                    true
        Position?                    2
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -OutputDir 
        The directory to put files in. Paths are relative to the project directory.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -ContextDir 
        The directory to put DbContext file in. Paths are relative to the project directory.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Context 
        The name of the DbContext to generate.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Schemas <String[]>
        The schemas of tables to generate entity types for.
        
        Required?                    false
        Position?                    named
        Default value                @()
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Tables <String[]>
        The tables to generate entity types for.
        
        Required?                    false
        Position?                    named
        Default value                @()
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -DataAnnotations []
        Use attributes to configure the model (where possible). If omitted, only the fluent API is used.
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -UseDatabaseNames []
        Use table and column names directly from the database.
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Force []
        Overwrite existing files.
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Project 
        The project to use.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -StartupProject 
        The startup project to use. Defaults to the solution's startup project.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
    
RELATED LINKS
    about_EntityFrameworkCore 



转载于:https://www.cnblogs.com/adandelion/p/10529788.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值