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

            int    rolId           = user.Role.Id;
            string userId          = user.Id;
            string establishmentId = user.Establishment.id;
            var    list            = new Response <IEnumerable <Food> >()
            {
                Success = true
            };

            list = _foodAgent.GetFoods(userId, establishmentId);

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