Ejemplo n.º 1
0
        public List <HUTModels.Food> GetListOfFoods()
        {
            List <HUTModels.Food> foods = repo.GetAll <HUTDataAccessLayerSQL.Food>()
                                          .Select(f => new HUTModels.Food()
            {
                CaloriesPer100Grams = f.CaloriesPer100Grams,
                Description         = f.Description,
                FoodId   = f.FoodId,
                PhotoURL = f.PhotoURL
            })
                                          .OrderBy(y => y.Description)
                                          .ToList();

            return(foods);
        }
Ejemplo n.º 2
0
        public List <HUTModels.Recipe> GetListOfRecipes()
        {
            List <HUTModels.Recipe> recipes = repo.GetAll <HUTDataAccessLayerSQL.Recipe>()
                                              .Select(r => new HUTModels.Recipe()
            {
                Archived    = r.Archived,
                DateEntered = r.DateEntered,
                Description = r.Description,
                RecipeId    = r.RecipeId
            })
                                              .OrderByDescending(y => y.Description)
                                              .OrderByDescending(x => x.DateEntered)
                                              .ToList();

            return(recipes);
        }
Ejemplo n.º 3
0
        public List <HUTModels.FreezerInventory> GetListOfInventory()
        {
            List <HUTModels.FreezerInventory> inventory = repo.GetAll <HUTDataAccessLayerSQL.FreezerInventory>()
                                                          .Select(f => new HUTModels.FreezerInventory()
            {
                FreezerInventoryId = f.FreezerInventoryId,
                ItemName           = f.ItemName,
                Quantity           = f.Quantity
            })
                                                          .OrderBy(y => y.ItemName)
                                                          .ToList();

            return(inventory);
        }