public ActionResult Delete(string username) { try { _storesService.Delete(_ => _.Username == username); _storesService.SaveChanges(); return(StatusCode(204)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public async Task <ActionResult> DeleteConfirmed(int id) { try { if (ModelState.IsValid) { // TODO: Add insert logic here await Service.Delete <Store>(id); return(RedirectToAction("Index")); } return(View()); } catch { return(View()); } }