public IEnumerable <IngredientInformationAndLocation> Get([FromQuery] string city) { Locations loc = Repo.GetLocationByCity(city); List <InventoryHasLocation> ingredientsIDs = new List <InventoryHasLocation> (); ingredientsIDs.AddRange(Repo.GetLocationInventoryByLocationId(loc.Id)); List <IngredientInformationAndLocation> returnIngredients = new List <IngredientInformationAndLocation>(); foreach (var item in ingredientsIDs) { returnIngredients.Add(new IngredientInformationAndLocation { Id = item.Id, LocationId = item.LocationId, InventoryId = item.InventoryId, Quantity = item.Quantity, IngredientName = Repo.GetIngredientNameById(item.InventoryId) }); } return(returnIngredients); }