//[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)] public async Task <IActionResult> Details(BirthOrderDetailViewModel formData) { try { if (ModelState.IsValid) { await _birthOrderServices.UpdateBirthOrderAsync(new BirthOrders { DateTimeModified = DateTimeOffset.Now, BirthOrder = formData.Name, Id = formData.Id, UserAccount = User.Identity.Name }); TempData["Message"] = "Changes saved successfully"; _logger.LogInformation($"Success: successfully updated {formData.Name} birth order record by user={@User.Identity.Name.Substring(4)}"); return(RedirectToAction("details", new { id = formData.Id })); } } catch (ApplicationException error) { ModelState.AddModelError("Birth", $"Failed to update record. {formData.Name} Contact IT ServiceDesk for support."); _logger.LogError( error, $"FAIL: failed to update {formData.Name} Birth Order. Internal Application Error.; user={@User.Identity.Name.Substring(4)}"); } return(View(formData)); }
//[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)] public async Task <IActionResult> Details(Guid id) { var birthQuery = await _birthOrderServices.GetBirthOrderById(id); if (birthQuery == null) { return(NotFound()); } var model = new BirthOrderDetailViewModel { Name = birthQuery.BirthOrder, Id = birthQuery.Id, }; return(View(model)); }