public async Task <User> RegisterAsync(User user, string password) { var role = await _roleManager.FindByNameAsync(Constants.Roles.User); var result = await CreateAsync(user, password, role); await SendEmailConfirmationAsync(result); await _domainEvents.RaiseAsync( new UserRegisteredEvent { User = result } ); return(result); }