public async Task <IHttpActionResult> PostCase(Case oCase) { if (!ModelState.IsValid) { return(InternalServerError()); } string sIPAddress = Request.GetOwinContext().Request.RemoteIpAddress; try { var Case = await oCaseRepo.CreateCase(oCase); oLogger.LogData("ROUTE: api/Case; METHOD: POST; IP_ADDRESS: " + sIPAddress); var Return = new { CaseID = Case.CaseID }; return(Json(Return)); } catch (Exception ex) { oLogger.LogData("ROUTE: api/Case; METHOD: POST; IP_ADDRESS: " + sIPAddress + "; EXCEPTION: " + ex.Message + "; INNER EXCEPTION: " + ex.InnerException); return(InternalServerError()); } }