Ejemplo n.º 1
0
        public async Task Seed()
        {
            if (!await Users.AnyAsync())
            {
                var data = new DataSamples();
                await Users.AddRangeAsync(data.Users.Select(u => u.Item1).ToArray());

                await IngredientTypes.AddRangeAsync(data.IngredientTypes);

                await Recipes.AddRangeAsync(data.Recipes);
                await SaveChangesAsync();
            }
        }