abp去掉AbpUser中的Name,Surname,去掉姓和名分离

abp是国外的框架,默认的框架中的AbpUser表中的Name和Surname是分开的,这不符合国情;可以先去掉

1. 在User类中重写Name和Surname,并设置为私有

abp去掉AbpUser中的Name,Surname,去掉姓和名分离_第1张图片

2. 在DbContext类中,重写OnModelCreating

abp去掉AbpUser中的Name,Surname,去掉姓和名分离_第2张图片

3. 添加数据库迁移

abp去掉AbpUser中的Name,Surname,去掉姓和名分离_第3张图片

4. 修改User相关的Dto: UserDto和CreateUserDto,在ContosoAbp.Application项目下的Users/Dto文件夹下

abp去掉AbpUser中的Name,Surname,去掉姓和名分离_第4张图片

5. 修改Users相关的界面:分别是ContosoAbp.Web.MVC项目下的Views/Users下的Index.cshtml和_EditUserModal.cshtml,注释掉Name,Surname,FullName相关的内容,至此修改完成,以后可以对user表添加其他属性

abp去掉AbpUser中的Name,Surname,去掉姓和名分离_第5张图片

你可能感兴趣的:(abp去掉AbpUser中的Name,Surname,去掉姓和名分离)