public JsonResult UpdateDish(Models.Dishes dish) { bool status = false; try { status = repository.UpdateDish(_mapper.Map <Dishes>(dish)); } catch (Exception) { status = false; } return(new JsonResult(status)); }
public JsonResult AddDish(Models.Dishes dish) { bool status = false; try { dish.Did = repository.GetNextDishId(); status = repository.AddDish(_mapper.Map <Dishes>(dish)); } catch (Exception) { status = false; } return(new JsonResult(status)); }