44using Jp . Application . ViewModels . ApiResouceViewModels ;
55using Jp . Application . ViewModels . ClientsViewModels ;
66using Jp . Application . ViewModels . IdentityResourceViewModels ;
7- using Jp . Application . ViewModels . RoleViewModels ;
8- using Jp . Application . ViewModels . UserViewModels ;
97using Jp . Domain . Commands . ApiResource ;
108using Jp . Domain . Commands . Clients ;
119using Jp . Domain . Commands . IdentityResource ;
1210using Jp . Domain . Commands . PersistedGrant ;
13- using Jp . Domain . Commands . Role ;
14- using Jp . Domain . Commands . User ;
15- using Jp . Domain . Commands . UserManagement ;
1611
1712namespace Jp . Application . AutoMapper
1813{
@@ -25,33 +20,6 @@ public ViewModelToDomainMappingProfile()
2520 */
2621 CreateMap < RemovePersistedGrantViewModel , RemovePersistedGrantCommand > ( ) . ConstructUsing ( c => new RemovePersistedGrantCommand ( c . Key ) ) ;
2722
28- /*
29- * User Creation Commands
30- */
31- CreateMap < RegisterUserViewModel , RegisterNewUserCommand > ( ) . ConstructUsing ( c => new RegisterNewUserCommand ( c . Username , c . Email , c . Name , c . PhoneNumber , c . Password , c . ConfirmPassword ) ) ;
32- CreateMap < SocialViewModel , RegisterNewUserWithoutPassCommand > ( MemberList . Source ) . ConstructUsing ( c => new RegisterNewUserWithoutPassCommand ( c . Email , c . Email , c . Name , c . Picture , c . Provider , c . ProviderId ) ) ;
33- CreateMap < RegisterUserViewModel , RegisterNewUserWithProviderCommand > ( ) . ConstructUsing ( c => new RegisterNewUserWithProviderCommand ( c . Username , c . Email , c . Name , c . PhoneNumber , c . Password , c . ConfirmPassword , c . Picture , c . Provider , c . ProviderId ) ) ;
34- CreateMap < ForgotPasswordViewModel , SendResetLinkCommand > ( ) . ConstructUsing ( c => new SendResetLinkCommand ( c . UsernameOrEmail , c . UsernameOrEmail ) ) ;
35- CreateMap < ResetPasswordViewModel , ResetPasswordCommand > ( ) . ConstructUsing ( c => new ResetPasswordCommand ( c . Password , c . ConfirmPassword , c . Code , c . Email ) ) ;
36- CreateMap < ConfirmEmailViewModel , ConfirmEmailCommand > ( ) . ConstructUsing ( c => new ConfirmEmailCommand ( c . Code , c . Email ) ) ;
37- CreateMap < SocialViewModel , AddLoginCommand > ( ) . ConstructUsing ( c => new AddLoginCommand ( c . Email , c . Provider , c . ProviderId ) ) ;
38-
39- /*
40- * User Management commands
41- */
42- CreateMap < UserViewModel , UpdateProfileCommand > ( ) . ConstructUsing ( c => new UpdateProfileCommand ( c . Id , c . Url , c . Bio , c . Company , c . JobTitle , c . Name , c . PhoneNumber ) ) ;
43- CreateMap < UserViewModel , UpdateUserCommand > ( ) . ConstructUsing ( c => new UpdateUserCommand ( c . Email , c . UserName , c . Name , c . PhoneNumber , c . EmailConfirmed , c . PhoneNumberConfirmed , c . TwoFactorEnabled , c . LockoutEnd , c . LockoutEnabled , c . AccessFailedCount ) ) ;
44- CreateMap < ProfilePictureViewModel , UpdateProfilePictureCommand > ( ) . ConstructUsing ( c => new UpdateProfilePictureCommand ( c . Id , c . Picture ) ) ;
45- CreateMap < ChangePasswordViewModel , ChangePasswordCommand > ( ) . ConstructUsing ( c => new ChangePasswordCommand ( c . Id , c . OldPassword , c . NewPassword , c . ConfirmPassword ) ) ;
46- CreateMap < SetPasswordViewModel , SetPasswordCommand > ( ) . ConstructUsing ( c => new SetPasswordCommand ( c . Id , c . NewPassword , c . ConfirmPassword ) ) ;
47- CreateMap < RemoveAccountViewModel , RemoveAccountCommand > ( ) . ConstructUsing ( c => new RemoveAccountCommand ( c . Id ) ) ;
48- CreateMap < SaveUserClaimViewModel , SaveUserClaimCommand > ( ) . ConstructUsing ( c => new SaveUserClaimCommand ( c . Username , c . Type , c . Value ) ) ;
49- CreateMap < RemoveUserClaimViewModel , RemoveUserClaimCommand > ( ) . ConstructUsing ( c => new RemoveUserClaimCommand ( c . Username , c . Type , c . Value ) ) ;
50- CreateMap < RemoveUserRoleViewModel , RemoveUserRoleCommand > ( ) . ConstructUsing ( c => new RemoveUserRoleCommand ( c . Username , c . Role ) ) ;
51- CreateMap < SaveUserRoleViewModel , SaveUserRoleCommand > ( ) . ConstructUsing ( c => new SaveUserRoleCommand ( c . Username , c . Role ) ) ;
52- CreateMap < RemoveUserLoginViewModel , RemoveUserLoginCommand > ( ) . ConstructUsing ( c => new RemoveUserLoginCommand ( c . Username , c . LoginProvider , c . ProviderKey ) ) ;
53- CreateMap < AdminChangePasswordViewodel , AdminChangePasswordCommand > ( ) . ConstructUsing ( c => new AdminChangePasswordCommand ( c . Password , c . ConfirmPassword , c . Username ) ) ;
54-
5523 /*
5624 * Client commands
5725 */
@@ -85,13 +53,6 @@ public ViewModelToDomainMappingProfile()
8553 CreateMap < RemoveApiScopeViewModel , RemoveApiScopeCommand > ( ) . ConstructUsing ( c => new RemoveApiScopeCommand ( c . Id , c . ResourceName ) ) ;
8654 CreateMap < SaveApiScopeViewModel , SaveApiScopeCommand > ( ) . ConstructUsing ( c => new SaveApiScopeCommand ( c . ResourceName , c . Name , c . Description , c . DisplayName , c . Emphasize , c . ShowInDiscoveryDocument , c . UserClaims ) ) ;
8755
88- /*
89- * Role commands
90- */
91- CreateMap < RemoveRoleViewModel , RemoveRoleCommand > ( ) . ConstructUsing ( c => new RemoveRoleCommand ( c . Name ) ) ;
92- CreateMap < SaveRoleViewModel , SaveRoleCommand > ( ) . ConstructUsing ( c => new SaveRoleCommand ( c . Name ) ) ;
93- CreateMap < RemoveUserFromRoleViewModel , RemoveUserFromRoleCommand > ( ) . ConstructUsing ( c => new RemoveUserFromRoleCommand ( c . Role , c . Username ) ) ;
94-
9556 }
9657 }
9758}
0 commit comments