public IEnumerable <IngredientListModel> GetAll() { using var dbContext = _dbContextFactory.Create(); return(dbContext.Ingredients .Select(e => IngredientMapper.MapIngredientEntityToListModel(e)).ToArray()); }
public void GetAll_Single_SeededWater() { var ingredient = _ingredientRepositorySUT .GetAll() .Single(i => i.Id == IngredientSeeds.Water.Id); Assert.Equal(IngredientMapper.MapIngredientEntityToListModel(IngredientSeeds.Water), ingredient, IngredientListModel.AllMembersComparer); }
public IEnumerable <IngredientListModel> GetAll() { using (var dbContext = dbContextFactory.CreateDbContext()) { return(dbContext.Ingredients .Select(e => IngredientMapper.MapIngredientEntityToListModel(e))); } }