// GET: Details/Delete/5 public async Task <ActionResult> Delete(int id) { var model = new DetailsBindingViewModels(); var response = await _clientHelper.GetDetail(id); if (response.IsSuccessStatusCode) { model = await response.Content.ReadAsAsync <DetailsBindingViewModels>(); } return(View(model)); }
public async Task <ActionResult> Delete(int id, DetailsBindingViewModels model) { try { var response = await _clientHelper.DeleteDetail(id); if (response.IsSuccessStatusCode) { return(RedirectToAction("Index")); } return(View(model)); } catch { return(View()); } }