Browse Source

Make TODO: Only run this if using a real database (#569)

use IsSqlServer extension method on catalogContext.Database (DatabaseFacade)
main
Cédric Michel 4 years ago
committed by GitHub
parent
commit
729354297f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/Infrastructure/Data/CatalogContextSeed.cs

7
src/Infrastructure/Data/CatalogContextSeed.cs

@ -15,8 +15,11 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
int retryForAvailability = retry.Value;
try
{
// TODO: Only run this if using a real database
// catalogContext.Database.Migrate();
if (catalogContext.Database.IsSqlServer())
{
catalogContext.Database.Migrate();
}
if (!await catalogContext.CatalogBrands.AnyAsync())
{
await catalogContext.CatalogBrands.AddRangeAsync(

Loading…
Cancel
Save