public ActionResult Delete_Confirm(int id) { var strError = string.Empty; if (id <= 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } try { _mainStore.Delete(id); //Clear cache CachingHelpers.ClearProviderCache(); } catch (Exception ex) { strError = NotifSettings.Error_SystemBusy; logger.Error("Failed to get Delete Provider because: " + ex.ToString()); return(Json(new { success = true, message = strError })); } return(Json(new { success = true, message = NotifSettings.Success_Deleted })); }
public async Task <IActionResult> Delete(long id) { try { await _storeProvider.Delete(id); var emptyModel = new Store(); var response = new StoreResponseModel(emptyModel); return(Ok(response)); } catch (Exception) { var result = new FailureModel(false, (int)HttpStatusCode.BadRequest, "Bad Request"); return(BadRequest(result)); } }