logger.LogWarning(exception,"[{prefix}] Exception {ExceptionType} with message {Message} detected on attempt {retry} of {retries}",nameof(TContext),exception.GetType().Name,exception.Message,retry,retries);
});
//if the sql server container is not created on run docker compose this
//migration can't fail for network related exception. The retry options for DbContext only
//apply to transient exceptions
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
logger.LogWarning(exception,"[{prefix}] Exception {ExceptionType} with message {Message} detected on attempt {retry} of {retries}",nameof(TContext),exception.GetType().Name,exception.Message,retry,retries);
});
logger.LogInformation("Migrated database associated with context {DbContextName}",typeof(TContext).Name);
//if the sql server container is not created on run docker compose this
//migration can't fail for network related exception. The retry options for DbContext only
//apply to transient exceptions
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
@ -92,11 +92,11 @@ public class CatalogContextSeed
{
{
returnnewList<CatalogBrand>()
returnnewList<CatalogBrand>()
{
{
newCatalogBrand(){Brand="Azure"},
newCatalogBrand(){Brand=".NET"},
newCatalogBrand(){Brand="Visual Studio"},
newCatalogBrand(){Brand="SQL Server"},
newCatalogBrand(){Brand="Other"}
new(){Brand="Azure"},
new(){Brand=".NET"},
new(){Brand="Visual Studio"},
new(){Brand="SQL Server"},
new(){Brand="Other"}
};
};
}
}
@ -147,10 +147,10 @@ public class CatalogContextSeed
{
{
returnnewList<CatalogType>()
returnnewList<CatalogType>()
{
{
newCatalogType(){Type="Mug"},
newCatalogType(){Type="T-Shirt"},
newCatalogType(){Type="Sheet"},
newCatalogType(){Type="USB Memory Stick"}
new(){Type="Mug"},
new(){Type="T-Shirt"},
new(){Type="Sheet"},
new(){Type="USB Memory Stick"}
};
};
}
}
@ -297,18 +297,18 @@ public class CatalogContextSeed
{
{
returnnewList<CatalogItem>()
returnnewList<CatalogItem>()
{
{
newCatalogItem{CatalogTypeId=2,CatalogBrandId=2,AvailableStock=100,Description=".NET Bot Black Hoodie",Name=".NET Bot Black Hoodie",Price=19.5M,PictureFileName="1.png"},
newCatalogItem{CatalogTypeId=1,CatalogBrandId=2,AvailableStock=100,Description=".NET Black & White Mug",Name=".NET Black & White Mug",Price=8.50M,PictureFileName="2.png"},
newCatalogItem{CatalogTypeId=2,CatalogBrandId=5,AvailableStock=100,Description="Prism White T-Shirt",Name="Prism White T-Shirt",Price=12,PictureFileName="3.png"},
newCatalogItem{CatalogTypeId=2,CatalogBrandId=2,AvailableStock=100,Description=".NET Foundation T-shirt",Name=".NET Foundation T-shirt",Price=12,PictureFileName="4.png"},
newCatalogItem{CatalogTypeId=3,CatalogBrandId=5,AvailableStock=100,Description="Roslyn Red Sheet",Name="Roslyn Red Sheet",Price=8.5M,PictureFileName="5.png"},
newCatalogItem{CatalogTypeId=2,CatalogBrandId=2,AvailableStock=100,Description=".NET Blue Hoodie",Name=".NET Blue Hoodie",Price=12,PictureFileName="6.png"},
newCatalogItem{CatalogTypeId=2,CatalogBrandId=5,AvailableStock=100,Description="Roslyn Red T-Shirt",Name="Roslyn Red T-Shirt",Price=12,PictureFileName="7.png"},
newCatalogItem{CatalogTypeId=1,CatalogBrandId=5,AvailableStock=100,Description="Cup<T> White Mug",Name="Cup<T> White Mug",Price=12,PictureFileName="9.png"},
newCatalogItem{CatalogTypeId=3,CatalogBrandId=2,AvailableStock=100,Description=".NET Foundation Sheet",Name=".NET Foundation Sheet",Price=12,PictureFileName="10.png"},
newCatalogItem{CatalogTypeId=2,CatalogBrandId=5,AvailableStock=100,Description="Prism White TShirt",Name="Prism White TShirt",Price=12,PictureFileName="12.png"},
new(){CatalogTypeId=2,CatalogBrandId=2,AvailableStock=100,Description=".NET Bot Black Hoodie",Name=".NET Bot Black Hoodie",Price=19.5M,PictureFileName="1.png"},
new(){CatalogTypeId=1,CatalogBrandId=2,AvailableStock=100,Description=".NET Black & White Mug",Name=".NET Black & White Mug",Price=8.50M,PictureFileName="2.png"},
new(){CatalogTypeId=2,CatalogBrandId=5,AvailableStock=100,Description="Prism White T-Shirt",Name="Prism White T-Shirt",Price=12,PictureFileName="3.png"},
new(){CatalogTypeId=2,CatalogBrandId=2,AvailableStock=100,Description=".NET Foundation T-shirt",Name=".NET Foundation T-shirt",Price=12,PictureFileName="4.png"},
new(){CatalogTypeId=3,CatalogBrandId=5,AvailableStock=100,Description="Roslyn Red Sheet",Name="Roslyn Red Sheet",Price=8.5M,PictureFileName="5.png"},
new(){CatalogTypeId=2,CatalogBrandId=2,AvailableStock=100,Description=".NET Blue Hoodie",Name=".NET Blue Hoodie",Price=12,PictureFileName="6.png"},
new(){CatalogTypeId=2,CatalogBrandId=5,AvailableStock=100,Description="Roslyn Red T-Shirt",Name="Roslyn Red T-Shirt",Price=12,PictureFileName="7.png"},
new(){CatalogTypeId=1,CatalogBrandId=5,AvailableStock=100,Description="Cup<T> White Mug",Name="Cup<T> White Mug",Price=12,PictureFileName="9.png"},
new(){CatalogTypeId=3,CatalogBrandId=2,AvailableStock=100,Description=".NET Foundation Sheet",Name=".NET Foundation Sheet",Price=12,PictureFileName="10.png"},
new(){CatalogTypeId=2,CatalogBrandId=5,AvailableStock=100,Description="Prism White TShirt",Name="Prism White TShirt",Price=12,PictureFileName="12.png"},
logger.LogWarning(exception,"[{prefix}] Exception {ExceptionType} with message {Message} detected on attempt {retry} of {retries}",nameof(TContext),exception.GetType().Name,exception.Message,retry,retries);
});
//if the sql server container is not created on run docker compose this
//migration can't fail for network related exception. The retry options for DbContext only
//apply to transient exceptions
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
logger.LogWarning(exception,"[{prefix}] Exception {ExceptionType} with message {Message} detected on attempt {retry} of {retries}",nameof(TContext),exception.GetType().Name,exception.Message,retry,retries);
});
logger.LogInformation("Migrated database associated with context {DbContextName}",typeof(TContext).Name);
//if the sql server container is not created on run docker compose this
//migration can't fail for network related exception. The retry options for DbContext only
//apply to transient exceptions
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
returnawaitconnection.QueryAsync<OrderSummary>(@"SELECT o.[Id] as ordernumber,o.[OrderDate] as [date],os.[Name] as [status], SUM(oi.units*oi.unitprice) as total
returnawaitconnection.QueryAsync<OrderSummary>(@"SELECT o.[Id] as ordernumber,o.[OrderDate] as [date],os.[Name] as [status], SUM(oi.units*oi.unitprice) as total