public IActionResult Delete(GeneralBodyPost GeneralBodyPost) { string transactionID = Guid.NewGuid().ToString(); string currentURL = this.Request.Method; HelperRestError helperRestError = new HelperRestError(); HelperHTTPLog helperHTTPLog = new HelperHTTPLog(HelperHTTPLog.WhatToLog.All); try { GeneralPostResponse resultContainer = new GeneralPostResponse(); resultContainer.ReportPostHeader.TransactionID = transactionID; RestExceptionError restExceptionError = null; RESTCategoriesDB rESTCategoriesDB = new RESTCategoriesDB(base.RESTConfig); DeleteCategoriesView viewToDelete = rESTCategoriesDB.TryParse <DeleteCategoriesView>(GeneralBodyPost, out restExceptionError); if (restExceptionError != null) { CreatedResult errorResult = helperRestError.GetError412_PreConditionFailed(transactionID, restExceptionError.ExceptionMessage, restExceptionError.InternalMessage, "Categories/Insert"); return(errorResult); } rESTCategoriesDB.TryDelete(viewToDelete, out restExceptionError); if (restExceptionError != null) { CreatedResult errorResult = helperRestError.GetError500_InternalServerError(transactionID, restExceptionError.ExceptionMessage, restExceptionError.InternalMessage, "Categories/GetAll"); return(errorResult); } resultContainer.ReportPostHeader.Message = "Success"; HttpResponseMessage httpResponseMessage = new HttpResponseMessage(); httpResponseMessage.StatusCode = System.Net.HttpStatusCode.OK; CreatedResult createdResult = new CreatedResult("Categories/Delete", httpResponseMessage); createdResult.Value = resultContainer; createdResult.StatusCode = 200; return(createdResult); } catch (Exception ex) { CreatedResult errorResult = helperRestError.GetError500_InternalServerError(transactionID, ex.Message, "x", "Categories/Create"); return(errorResult); } }