public BaseResponse <int> Add([FromBody] Food food) { BaseResponse <int> response = null; try { string token = Request.Headers["Auth"]; User user = businessLogicLayer.Check(token); int foodId = businessLogicLayer.AddFoodWithProducts(user.Id, food); response = new BaseResponse <int>(foodId); } catch (Exception ex) { response = new BaseResponse <int> { Error = ex.Message }; } return(response); }