Ejemplo n.º 1
0
        public async Task <JsonResult> Create(FoodViewModel model)
        {
            var user = HttpContext.Session.Get <User>(Constants.SessionKeyState);

            int rolId = user.Role.Id;

            model.userId          = user.Id;
            model.establishmentId = user.Establishment.id;

            var entity = model.ToFoodModel();

            var response = _foodAgent.CreateFood(entity);

            return(await Task.FromResult(Json(response)));
        }