Make TODO: Only run this if using a real database (#569)
use IsSqlServer extension method on catalogContext.Database (DatabaseFacade)
This commit is contained in:
@@ -15,8 +15,11 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
|
|||||||
int retryForAvailability = retry.Value;
|
int retryForAvailability = retry.Value;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// TODO: Only run this if using a real database
|
if (catalogContext.Database.IsSqlServer())
|
||||||
// catalogContext.Database.Migrate();
|
{
|
||||||
|
catalogContext.Database.Migrate();
|
||||||
|
}
|
||||||
|
|
||||||
if (!await catalogContext.CatalogBrands.AnyAsync())
|
if (!await catalogContext.CatalogBrands.AnyAsync())
|
||||||
{
|
{
|
||||||
await catalogContext.CatalogBrands.AddRangeAsync(
|
await catalogContext.CatalogBrands.AddRangeAsync(
|
||||||
|
|||||||
Reference in New Issue
Block a user