File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
aspnet-core/src/AbpCompanyName.AbpProjectName.Application/Users Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 2
2
using Abp . Auditing ;
3
3
using Abp . Authorization . Users ;
4
4
using Abp . AutoMapper ;
5
+ using Abp . Runtime . Validation ;
5
6
using AbpCompanyName . AbpProjectName . Authorization . Users ;
6
7
7
8
namespace AbpCompanyName . AbpProjectName . Users . Dto
8
9
{
9
10
[ AutoMapTo ( typeof ( User ) ) ]
10
- public class CreateUserDto
11
+ public class CreateUserDto : IShouldNormalize
11
12
{
12
13
[ Required ]
13
14
[ StringLength ( AbpUserBase . MaxUserNameLength ) ]
@@ -34,5 +35,13 @@ public class CreateUserDto
34
35
[ StringLength ( AbpUserBase . MaxPlainPasswordLength ) ]
35
36
[ DisableAuditing ]
36
37
public string Password { get ; set ; }
38
+
39
+ public void Normalize ( )
40
+ {
41
+ if ( RoleNames == null )
42
+ {
43
+ RoleNames = new string [ 0 ] ;
44
+ }
45
+ }
37
46
}
38
47
}
Original file line number Diff line number Diff line change 9
9
using Microsoft . AspNetCore . Identity ;
10
10
using System . Linq ;
11
11
using Abp . Authorization ;
12
+ using Abp . Authorization . Users ;
12
13
using Microsoft . EntityFrameworkCore ;
13
14
using Abp . IdentityFramework ;
14
15
using AbpCompanyName . AbpProjectName . Authorization . Roles ;
You can’t perform that action at this time.
0 commit comments