Beispiel #1
0
        public static async Task RemoveEntity(PicoBeerContext picoBeerContext)
        {
            IEnumerable <T> list = picoBeerContext.Set <T>().AsEnumerable();

            picoBeerContext.RemoveRange(list);
            await picoBeerContext.SaveChangesAsync();
        }
Beispiel #2
0
        public static async Task SeedAsync(PicoBeerContext picoBeerContext)
        {
            _picoBeerContext = picoBeerContext;
            await RemoveAll();

            picoBeerContext.Malt.AddRange(getListMalt());
            picoBeerContext.Hop.AddRange(getListHop());
            picoBeerContext.Yeast.AddRange(getListYeast());
            picoBeerContext.Recipe.AddRange(getListRecipe());

            await picoBeerContext.SaveChangesAsync();
        }