public JsonResult AddMenu(MenuViewModel model) { try { _restaurantManagement.AddMenu(model.MapToBusinessModel()); return(Json(new { success = true })); } catch (Exception ex) { _logger.LogError(ex); return(Json(new { success = false, message = ex.Message })); } }
public ActionResult Create(MenuViewModel model) { try { _restaurantManagement.AddMenu(model.MapToBusinessModel()); } catch (Exception ex) { _logger.LogError(ex); throw; } return(RedirectToAction("Index")); }