//[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)] public async Task <IActionResult> Details(RelationshipTypeDetailViewModel formData) { try { if (ModelState.IsValid) { await _relationshipTypeServices.UpdateRelationshipTypeAsync(new RelationShipType { DateTimeModified = DateTimeOffset.Now, Title = formData.Title, Id = formData.Id, UserAccount = User.Identity.Name }); TempData["Message"] = "Changes saved successfully"; _logger.LogInformation($"Success: successfully updated {formData.Title} Relationship record by user={@User.Identity.Name.Substring(4)}"); return(RedirectToAction("details", new { id = formData.Id })); } } catch (ApplicationException error) { ModelState.AddModelError("Relationship", $"Failed to update record. {formData.Title} Contact IT ServiceDesk for support."); _logger.LogError( error, $"FAIL: failed to update {formData.Title} Relationship. 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 relationshipQuery = await _relationshipTypeServices.GetRelationshipsById(id); if (relationshipQuery == null) { return(NotFound()); } var model = new RelationshipTypeDetailViewModel { Title = relationshipQuery.Title, Id = relationshipQuery.Id, }; return(View(model)); }