public async Task <ActionResultV7> Create(AccountRequestModelV7 model) { ValidationResultV7 result = this.modelValidator.Validate(model); if (result.Success) { if (!await this.fbiService.VerifyWithFBI(model.SSN)) { return(new ActionResultV7(false, new ValidationResultV7(false, "Unable to validate with FBI"))); } var account = new Account(0, model.Name, model.SSN, DateTime.Now, model.Token); this.repository.Create(account); return(new ActionResultV7(true, account)); } else { return(new ActionResultV7(result)); } }
public ActionResultV7(ValidationResultV7 result) { this.Success = result.Success; this.Object = result.Message; }