File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
aspnet-core/src/AbpCompanyName.AbpProjectName.Application Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ public async Task CreateTenant(CreateTenantInput input)
7272 using ( CurrentUnitOfWork . SetTenantId ( tenant . Id ) )
7373 {
7474 //Create static roles for new tenant
75- await _roleManager . CreateStaticRoles ( tenant . Id ) ;
75+ CheckErrors ( await _roleManager . CreateStaticRoles ( tenant . Id ) ) ;
7676
7777 await CurrentUnitOfWork . SaveChangesAsync ( ) ; //To get static role ids
7878
@@ -83,11 +83,11 @@ public async Task CreateTenant(CreateTenantInput input)
8383 //Create admin user for the tenant
8484 var adminUser = User . CreateTenantAdminUser ( tenant . Id , input . AdminEmailAddress ) ;
8585 adminUser . Password = _passwordHasher . HashPassword ( adminUser , User . DefaultPassword ) ;
86- await UserManager . CreateAsync ( adminUser ) ;
86+ CheckErrors ( await UserManager . CreateAsync ( adminUser ) ) ;
8787 await CurrentUnitOfWork . SaveChangesAsync ( ) ; //To get admin user's id
8888
8989 //Assign admin user to role!
90- await UserManager . AddToRoleAsync ( adminUser , adminRole . Name ) ;
90+ CheckErrors ( await UserManager . AddToRoleAsync ( adminUser , adminRole . Name ) ) ;
9191 await CurrentUnitOfWork . SaveChangesAsync ( ) ;
9292 }
9393 }
Original file line number Diff line number Diff line change 22using System . Threading . Tasks ;
33using Abp . Application . Services . Dto ;
44using Abp . Authorization ;
5- using Abp . AutoMapper ;
65using Abp . Domain . Repositories ;
76using AbpCompanyName . AbpProjectName . Authorization ;
87using AbpCompanyName . AbpProjectName . Authorization . Users ;
@@ -41,7 +40,7 @@ public async Task ProhibitPermission(ProhibitPermissionInput input)
4140 public async Task RemoveFromRole ( long userId , string roleName )
4241 {
4342 var user = await UserManager . FindByIdAsync ( userId . ToString ( ) ) ;
44- await UserManager . RemoveFromRoleAsync ( user , roleName ) ;
43+ CheckErrors ( await UserManager . RemoveFromRoleAsync ( user , roleName ) ) ;
4544 }
4645
4746 public async Task < ListResultDto < UserListDto > > GetUsers ( )
@@ -61,7 +60,7 @@ public async Task CreateUser(CreateUserInput input)
6160 user . Password = _passwordHasher . HashPassword ( user , input . Password ) ;
6261 user . IsEmailConfirmed = true ;
6362
64- await UserManager . CreateAsync ( user ) ;
63+ CheckErrors ( await UserManager . CreateAsync ( user ) ) ;
6564 }
6665 }
6766}
You can’t perform that action at this time.
0 commit comments