一、建立abp项目
1 通过abp官网https://aspnetboilerplate.com/,官网有生成abp项目的快速方式,可以选择生成augular,react ,vue的前端,也可以用asp.net的mvc
2 通过abp cli搭建
1)安装或升级abp cli
abp cli是使用ABP框架启动新解决方案的最快方法,那么前提是需要安装
dotnet tool install -g Volo.Abp.Cli
如果你的版本比较低,使用下面命令进行更新
dotnet tool update -g Volo.Abp.Cli
2)使用方法,请参考 https://docs.abp.io/en/abp/latest/CLI
使用命令abp new
二、使用abphelper快速生成代码
参考https://github.com/EasyAbp/AbpHelper.CLI
1)Install AbpHelper CLI tool
dotnet tool install EasyAbp.AbpHelper -g
update it with the following command:
dotnet tool update EasyAbp.AbpHelper -g
2)建立领域模型
public class Todo : FullAuditedEntity
{
public string Content { get; set; }
public bool Done { get; set; }
}
abphelper generate crud Todo -d C:\MyTodo
generate crud is a sub command to generate CRUD files,Todo specified the entity name we created earlier-d specified the root directory of the ABP project, which is created by the ABP CLI
AbpHelper will generate all the CRUD stuffs , even include adding migration and database updating!
3)Run the DbMigrator to seed the database
原文:https://www.cnblogs.com/charlesyuan/p/14132747.html