Esempio n. 1
0
        public ActionResult <List <ConsumptionMonth> > Get()
        {
            string loggedUser = User.FindFirstValue("userId");

            if (loggedUser == null)
            {
                return(Unauthorized());
            }

            List <ConsumptionMonth> consumption = consumptionService.GetConsumptionsPerMonth();

            if (consumption == null)
            {
                return(NotFound());
            }
            return(consumption);
        }