Arguments: generator Name of the generator. Check available generators below.
Options: -p|--project Path to .csproj file in the project. -n|--nuget-package-dir -c|--configuration Configuration for the project (Possible values: Debug/ Release) -tfm|--target-framework Target Framework to use. (Short folder name of the tfm. eg. net46) -b|--build-base-path --no-build Selected Code Generator: razorpage Generator Arguments: razorPageName : Name of the Razor Page templateName : The template to use, supported view templates: 'Empty|Create|Edit|Delete|Details|List' Generator Options: --model|-m : Model class to use --dataContext|-dc : DbContext class to use --referenceScriptLibraries|-scripts : Switch to specify whether to reference script libraries in the generated views --layout|-l : Custom Layout page to use --useDefaultLayout|-udl : Switch to specify that default layout should be used for the views --force|-f : Use this option to overwrite existing files --relativeFolderPath|-outDir : Specify the relative output folder path from project where the file needs to be generated, if not specified, file will be generated in the project folder --namespaceName|-namespace : Specify the name of the namespace to use for the generated PageModel --partialView|-partial : Generate a partial view, other layout options (-l and -udl) are ignored ifthisis specified --noPageModel|-npm : Switch to not generate a PageModel class for Empty template 用法:aspnet-codegenerator [arguments] [options]
初始迁移
1 2 3 4
1) 运行 Dotnet core CLI 命令 dotnet ef migrations add InitialCreate //添加迁移 //InitialCreate 执行一次之后再次执行会提示执行迁移记录名重复 dotnet ef database update //更新数据模型