public JsonResult Delete(System.Int32 id) { RemoveMenuItemRequest request = new RemoveMenuItemRequest(); request.MenuItemId = id; RemoveMenuItemResponse response = _menuItemService.RemoveMenuItem(request); return(Json(response)); }
public RemoveMenuItemResponse RemoveMenuItem(RemoveMenuItemRequest request) { RemoveMenuItemResponse response = new RemoveMenuItemResponse(); response.Errors = new List <BusinessRule>(); try { if (_menuItemRepository.Remove(request.MenuItemId) > 0) { response.MenuItemDeleted = true; } } catch (Exception ex) { response.Errors.Add(new BusinessRule("DAL", "DAL_ERROR: " + ex.Message)); } return(response); }