public override async Task <List <DAL.App.DTO.FoodItem> > AllAsync() { return(await RepositoryDbSet .Include(item => item.Provider) .Include(item => item.FoodCategory) .Include(item => item.Prices) .Select(item => FoodItemMapper.MapFromDomain(item)) .ToListAsync()); }
public async Task <IEnumerable <FoodItem> > GetMeat() { return(FoodItemSeeder.GetDummyMeat()); var willys = await FoodService.GetStoreProducts(Store.Coop, Category.Meat); var willysFoodItems = FoodItemMapper.MapProductsToFoodItems(willys, "Coop"); return(willysFoodItems); }
public async Task <ActionResult <PublicApi.v1.DTO.FoodItem> > GetFoodItem(int id) { var foodItem = await _bll.FoodItems.FindAsync(id); if (foodItem == null) { return(NotFound()); } return(FoodItemMapper.MapFromBLL(foodItem)); }
public async Task <IEnumerable <FoodItem> > GetCityGrossProducts() { var cityGrossProducts = await FoodService.GetCityGrossProducts(); //var cityGrossProducts = new List<CityGrossProduct>() //{ // new CityGrossProduct() // { // ProductID = 0, // Title = "Herrgårdsost 28%", // Price = 74.95, // Unit = "/kg", // Weight = "ca 700g", // Manufacturer = "Favorit", // ImageURL = "https://www.citygross.se//images/products/02340388600002_C1N1-600.jpg" // } //}; var foodItems = FoodItemMapper.MapCityGrossProductsToFoodItems(cityGrossProducts, "CityGross"); return(foodItems); }
public async Task <IEnumerable <FoodItem> > GetCheese() { //var test = await FoodService.GetStoreProducts("Willys"); return(FoodItemSeeder.GetDummyFoodItems()); var willysProducts = await FoodService.GetStoreProducts(Store.Willys, Category.Cheese); var willysFoodItems = FoodItemMapper.MapProductsToFoodItems(willysProducts, "Willys"); //return willysFoodItems; var coopProducts = await FoodService.GetStoreProducts(Store.Coop, Category.Cheese); var coopFoodItems = FoodItemMapper.MapProductsToFoodItems(coopProducts, "Coop", willysFoodItems.Count); var allFoodItems = new List <FoodItem>(); allFoodItems.AddRange(willysFoodItems); allFoodItems.AddRange(coopFoodItems); return(allFoodItems); //return willysFoodItems; }