public IHttpActionResult EditElement(Element element) { if (element == null) { return(BadRequest("element cannot be found in the request body request")); } try { var original = elementsService.GetElement(element.ElementId); element.IsActive = true; element.CreatedDate = original.CreatedDate; elementsService.EditElement(element); var elements = elementsService.GetElements(); var partialView = Helpers.RenderPartial("~/Views/Shared/Partial/Elements/ElementsList.cshtml", elements); return(Ok(partialView)); } catch (Exception ex) { return(InternalServerError(ex)); } }