public async Task <IdentityResult> CreateAsync(Role role, CancellationToken cancellationToken) { _roleRepository.Add(role); await _dapperTransactionService.RunOperations(cancellationToken); return(IdentityResult.Success); }
public async Task <IdentityResult> CreateAsync(User user, CancellationToken cancellationToken) { try { _userRepository.Add(user); await _dapperTransactionService.RunOperations(cancellationToken); return(IdentityResult.Success); } catch (DuplicateUserNameException) { return(IdentityResult.Failed(_identityErrorDescriber.DuplicateUserName(user.UserName))); } }