Пример #1
0
        public static async Task RecreateAndSeedAsync(
            string connectionString,
            Restaurant.Builder restaurantBuilder)
        {
            using (var context = new RestaurantContext(connectionString))
            {
                await context.Database.EnsureDeletedAsync();

                await context.Database.EnsureCreatedAsync();

                await context.SeedAsync(restaurantBuilder.Build());
            }
        }