public async Task <IActionResult> Apply([FromBody] ApplyModel applyModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } ApplicationView application = await applyModel.GetApplication(_dbContext, null); await _emailSender.SendApplicationConfirmAsync(application); return(Ok(application)); }
public async Task <IActionResult> Apply([Bind("ApplyModel")] MapModel mapModel) { if (ModelState.IsValid) { ApplyModel applyModel = mapModel.ApplyModel; var user = await GetUser(applyModel.Email); ApplicationView application = await applyModel.GetApplication(_dbContext, user); await _emailSender.SendApplicationConfirmAsync(application); return(Ok()); } return(Error()); }