public async Task <ActionResult> Edit(Guid readerId, InputModel model) { try { await _repository.Update(readerId, new Reader(model.EmailAddress, model.Username, model.Name)); return(StatusCode(StatusCodes.Status200OK)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex)); } }
public async Task <ActionResult> Edit(Guid readerId, ReaderInputModel model) { try { if (!ModelState.IsValid) { return(View("~/Views/Readers/CreateOrUpdate.cshtml", model)); } await _repository.Update(readerId, model); return(RedirectToAction(nameof(Index))); } catch { return(View("~/Views/Readers/CreateOrUpdate.cshtml", model)); } }