private async Task <object> SignUp() { var model = this.BindAndValidate <SignUpViewModel>(); if (!ModelValidationResult.IsValid) { return(Negotiate .WithModel(ModelValidationResult.FormattedErrors) .WithStatusCode(HttpStatusCode.UnprocessableEntity)); } var command = new SignUpCommand( model.Username, model.Email, hashingService.HashPassword(model.Password) ); await busClient.Send(command); return(HttpStatusCode.Accepted); }
public static string HashPassword(this IAccountCredentials credentials) { return(HashingService.HashPassword(credentials)); }