Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
d11b66a
Initial addition of CosmosDB support, based on SqlServer
Pilchie Oct 3, 2023
3374fb6
Remove Healthchecks support from CosmosDB EF Component
Pilchie Oct 11, 2023
1e60bf5
DO NOT MERGE: Update sample to use CosmosDB instead of PostgreSQL
Pilchie Oct 1, 2023
4eaae64
Cleanup connection string handling in Cosmos EF
Pilchie Oct 17, 2023
6421e60
Cleanup connection string handling in Cosmos component
Pilchie Oct 17, 2023
07d8284
Update CosmosDB package to get OTel support
Pilchie Oct 17, 2023
8dae4bd
Use the parent name for the connection
Pilchie Oct 17, 2023
f706813
Revert last change
Pilchie Oct 17, 2023
3f8b528
Fix text build break
Pilchie Oct 17, 2023
0ac6633
Remove cruft around configuration schema
Pilchie Oct 17, 2023
ed5c74b
Udpate manifest strings
Pilchie Oct 18, 2023
8b72bf0
Add CosmosDB components to Progress and Telemetry
Pilchie Oct 18, 2023
a98aaee
Rename CosmosDB components to Aspire.Azure.Data.Cosmos[.EntityFramewo…
Pilchie Oct 18, 2023
3f0bb37
Rename Cosmos DB directories
Pilchie Oct 18, 2023
4bd8129
Rename some namespaces and related
Pilchie Oct 18, 2023
9d7442a
Rename options -> settings
Pilchie Oct 19, 2023
aff38a2
Rename Cosmos Components to follow naming guidelines
Pilchie Oct 20, 2023
9cf1d52
Merge remote-tracking branch 'upstream/main' into azure-cosmosdb
Pilchie Oct 24, 2023
a4a9b29
Fix mis-merges
Pilchie Oct 25, 2023
9b412bd
Update to CosmosDB preview package and pin to get OpenTelemetry support
Pilchie Oct 25, 2023
4709022
Merge remote-tracking branch 'upstream/main' into azure-cosmosdb
Pilchie Oct 26, 2023
dcab2df
Update comments and add Keyed DI to Aspire.Microsoft.Azure.Cosmos
Pilchie Oct 27, 2023
2067377
Update exception message
Pilchie Oct 27, 2023
ce8f094
Add log categories to Cosmos Component schemas
Pilchie Oct 27, 2023
46db475
Add basic support for CosmosClientOptions (no IConfiguration binding …
Pilchie Oct 27, 2023
49908bd
Remove healthchecks support from CosmosDB Component
Pilchie Oct 30, 2023
e5c96ac
Add README for Aspire.Microsoft.Azure.Cosmos
Pilchie Oct 30, 2023
8d04a70
Add README for Aspire.Microsoft.EntityFrameworkCore.Cosmos, and renam…
Pilchie Oct 30, 2023
0af6420
Update config schema to be nested for Aspire.Microsoft.EntityFramewor…
Pilchie Oct 30, 2023
c9f434c
Rename AzureDataCosmosSettings -> AzureCosmosDBSettings
Pilchie Oct 30, 2023
c880d96
Remove metrics support from Aspire.Microsoft.Azure.Cosmos
Pilchie Oct 30, 2023
e495d03
Remove WithAzureCosmosDB extension from hosting
Pilchie Oct 30, 2023
f2feb2b
Remove setting for DatabaseName from Aspire.Microsoft.EntityFramework…
Pilchie Oct 30, 2023
053e84b
Rename AzureEntityFrameworkCoreCosmosDBSettings -> EntityFrameworkCor…
Pilchie Oct 30, 2023
2765016
Update Aspire_Components_Progress.md
Pilchie Oct 30, 2023
6770b32
Prepare to make Aspire install by default on upgrades for web workloa…
danegsta Oct 26, 2023
77d4b68
Text alignment with ellipsis (#536)
tlmii Oct 26, 2023
e8a6bda
Metrics page alignment (#537)
tlmii Oct 26, 2023
447e1d3
Provide an explicit target to generate the Aspire manifest (#534)
baronfel Oct 27, 2023
64c0994
Fix one place where service discovery isn't AOT compatible (#540)
davidfowl Oct 27, 2023
735035e
Updated otel versions to latest (#542)
davidfowl Oct 27, 2023
362baf5
Add log level select (#541)
JamesNK Oct 27, 2023
254e82e
Display Container ID (#544)
tlmii Oct 27, 2023
b0db3db
Enable ConfigurationBinder source gen on components by default (#535)
eerhardt Oct 27, 2023
952f5fd
Service Discovery: make host name propagation opt-in (#548)
ReubenBond Oct 27, 2023
3f03c80
Fix Aspire.Npgsql.csproj to be packable (#549)
eerhardt Oct 27, 2023
0f413bd
Update dependencies from https://github.com/dotnet/arcade build 20231…
dotnet-maestro[bot] Oct 27, 2023
c491f20
Fix metrics applications list (#552)
tlmii Oct 27, 2023
bc01c19
Add unit test coverage for redis, postgres, containers (#551)
BrennanConroy Oct 27, 2023
bf0e4fa
Add new DistributedApplicationOptions object, refactor DCP location c…
danegsta Oct 27, 2023
e580324
Use correct metadata name (#555)
danegsta Oct 27, 2023
484f53b
Add RabbitMQ Component (#556)
eerhardt Oct 28, 2023
8573329
Support running multiple instances of DAB in the same process (#560)
davidfowl Oct 28, 2023
f1a8a79
Display new error logs count to projects page (#545)
JamesNK Oct 28, 2023
2c9699e
Update Azure dependencies to latest versions (#563)
eerhardt Oct 29, 2023
7474fd1
Fixes creation of user secrets when user secrets does not yet exist (…
bjorkstromm Oct 29, 2023
3584144
Various log filter fixes (#571)
JamesNK Oct 30, 2023
5ab2c0b
Update metrics page to use SelectViewModel (#573)
JamesNK Oct 30, 2023
1cb8dcd
Change Dashboard to use Fluent UI vNext (#575)
vnbaaij Oct 30, 2023
49af7e4
[main] Update dependencies from microsoft/usvc-apiserver (#577)
dotnet-maestro[bot] Oct 30, 2023
5653395
Simplify view model caching (#557)
smitpatel Oct 30, 2023
bce48ec
Details Views (#561)
tlmii Oct 30, 2023
828f5dd
Account for case sensitive paths on nix systems (#584)
danegsta Oct 31, 2023
54326ee
Adds Azure hosting support for App Configuration (#574)
bjorkstromm Oct 31, 2023
20138fa
Switch to using Path.GetRandomFileName() from uuid (#587)
danegsta Oct 31, 2023
6cbcac5
Fix trace order (#588)
JamesNK Oct 31, 2023
6ed5925
Add TokenCredential support to Aspire.Microsoft.EntityFrameworkCore.C…
Pilchie Oct 31, 2023
92ecb4c
Add TokenCredential support to Aspire.Microsoft.Azure.Cosmos
Pilchie Oct 31, 2023
61d05e9
Merge remote-tracking branch 'upstream/main' into azure-cosmosdb
Pilchie Oct 31, 2023
85a66a8
Add empty RatingsService
Pilchie Oct 31, 2023
4f01310
Add a RatingsService and use it from the frontend
Pilchie Nov 1, 2023
8d76cc1
Revert changes to catalogdb
Pilchie Nov 1, 2023
0130296
Update expected service lifetime to singleton
Pilchie Nov 1, 2023
f22856d
Revert "Add a RatingsService and use it from the frontend"
Pilchie Nov 1, 2023
c86dec1
Revert "Add empty RatingsService"
Pilchie Nov 1, 2023
97aa291
Apply suggestions from code review
Pilchie Nov 1, 2023
b372614
Merge remote-tracking branch 'upstream/main' into azure-cosmosdb
Pilchie Nov 1, 2023
7898ce9
Fix project type guid
Pilchie Nov 1, 2023
932723c
Remove TODO
Pilchie Nov 1, 2023
6214639
Fix typo in exception message
Pilchie Nov 1, 2023
24c71a4
Add PackageTags, Descriptions, and Icons
Pilchie Nov 1, 2023
138579d
Add AccountEndpoint to ConfigurationScheama.json
Pilchie Nov 1, 2023
3f53c4f
Remove healthcheck from comment
Pilchie Nov 1, 2023
0a40231
A couple more code review fixes
Pilchie Nov 1, 2023
3209cc5
WIP
Pilchie Nov 1, 2023
2f89327
Merge remote-tracking branch 'upstream/main' into azure-cosmosdb
Pilchie Nov 1, 2023
ea41461
Fix DB context builder config
Pilchie Nov 2, 2023
2a17893
Add xml doc comments for CosmosDB hosting methods and types
Pilchie Nov 2, 2023
0058fa1
Move Cosmos DB hosting to Aspire.Hosting.Azure
Pilchie Nov 2, 2023
2a3d1cc
Update manifest type names
Pilchie Nov 2, 2023
f58be30
Merge branch 'main' into azure-cosmosdb
mitchdenny Nov 2, 2023
9595b88
Respond to PR feedback
eerhardt Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Azure.Provisioning", "src\Aspire.Hosting.Azure.Provisioning\Aspire.Hosting.Azure.Provisioning.csproj", "{D4BD974F-6505-43FC-A94E-2019F0DB5D5D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eShopLite", "eShopLite", "{A68BA1A5-1604-433D-9778-DC0199831C2A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Azure.CosmosDB", "src\Components\Aspire.Azure.CosmosDB\Aspire.Azure.CosmosDB.csproj", "{23298562-C1D4-41CD-83FE-426C94FEE35F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Azure.EntityFrameworkCore.CosmosDB", "src\Components\Aspire.Azure.EntityFrameworkCore.CosmosDB\Aspire.Azure.EntityFrameworkCore.CosmosDB.csproj", "{00C9BA50-2AFB-4D9C-A2D6-8154BCCD0A63}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Azure.CosmosDB.Tests", "tests\Aspire.Azure.CosmosDB.Tests\Aspire.Azure.CosmosDB.Tests.csproj", "{A5836BC1-6A45-4BB6-9D22-A7F750890AB8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Azure.EntityFrameworkCore.CosmosDB.Tests", "tests\Aspire.Azure.EntityFrameworkCore.CosmosDB.Tests\Aspire.Azure.EntityFrameworkCore.CosmosDB.Tests.csproj", "{FDA02617-9C49-4DA8-A43A-A34DBA9B8596}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -359,6 +366,22 @@ Global
{D4BD974F-6505-43FC-A94E-2019F0DB5D5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4BD974F-6505-43FC-A94E-2019F0DB5D5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4BD974F-6505-43FC-A94E-2019F0DB5D5D}.Release|Any CPU.Build.0 = Release|Any CPU
{23298562-C1D4-41CD-83FE-426C94FEE35F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23298562-C1D4-41CD-83FE-426C94FEE35F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23298562-C1D4-41CD-83FE-426C94FEE35F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23298562-C1D4-41CD-83FE-426C94FEE35F}.Release|Any CPU.Build.0 = Release|Any CPU
{00C9BA50-2AFB-4D9C-A2D6-8154BCCD0A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00C9BA50-2AFB-4D9C-A2D6-8154BCCD0A63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00C9BA50-2AFB-4D9C-A2D6-8154BCCD0A63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00C9BA50-2AFB-4D9C-A2D6-8154BCCD0A63}.Release|Any CPU.Build.0 = Release|Any CPU
{A5836BC1-6A45-4BB6-9D22-A7F750890AB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5836BC1-6A45-4BB6-9D22-A7F750890AB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5836BC1-6A45-4BB6-9D22-A7F750890AB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5836BC1-6A45-4BB6-9D22-A7F750890AB8}.Release|Any CPU.Build.0 = Release|Any CPU
{FDA02617-9C49-4DA8-A43A-A34DBA9B8596}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDA02617-9C49-4DA8-A43A-A34DBA9B8596}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDA02617-9C49-4DA8-A43A-A34DBA9B8596}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDA02617-9C49-4DA8-A43A-A34DBA9B8596}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -423,6 +446,10 @@ Global
{E2EC79D0-80F7-4471-9613-D7C8C3D52F95} = {B80354C7-BE58-43F6-8928-9F3A74AB7F47}
{D4BD974F-6505-43FC-A94E-2019F0DB5D5D} = {B80354C7-BE58-43F6-8928-9F3A74AB7F47}
{A68BA1A5-1604-433D-9778-DC0199831C2A} = {D173887B-AF42-4576-B9C1-96B9E9B3D9C0}
{23298562-C1D4-41CD-83FE-426C94FEE35F} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2}
{00C9BA50-2AFB-4D9C-A2D6-8154BCCD0A63} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2}
{A5836BC1-6A45-4BB6-9D22-A7F750890AB8} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
{FDA02617-9C49-4DA8-A43A-A34DBA9B8596} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C}
Expand Down
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PackageVersion Include="Azure.Security.KeyVault.Secrets" Version="4.5.0" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.17.0" />
<PackageVersion Include="Azure.Storage.Queues" Version="12.15.0" />
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.35.4-preview" />
Comment thread
mitchdenny marked this conversation as resolved.
Outdated
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.0" />
<!-- Azure Management SDK for .NET dependencies -->
<PackageVersion Include="Azure.ResourceManager.KeyVault" Version="1.2.0-beta.2" />
Expand Down Expand Up @@ -42,6 +43,7 @@
<!-- sql client dependencies -->
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.1" />
<!-- efcore dependencies -->
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="8.0.0-rtm.23512.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-rtm.23512.13" />
<!-- runtime dependencies-->
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="$(RuntimeVersion)" />
Expand Down
5 changes: 2 additions & 3 deletions samples/eShopLite/AppHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
var grafana = builder.AddContainer("grafana", "grafana/grafana")
.WithServiceBinding(containerPort: 3000, name: "grafana-http", scheme: "http");

var catalogdb = builder.AddPostgresContainer("postgres").AddDatabase("catalog");
var catalogdb = builder.AddAzureCosmosDB("cosmosdb").AddDatabase("catalogdb");
Comment thread
Pilchie marked this conversation as resolved.
Outdated

var redis = builder.AddRedisContainer("basketCache");

var catalog = builder.AddProject<Projects.CatalogService>("catalogservice")
.WithReference(catalogdb)
.WithReplicas(2);
.WithAzureCosmosDB(catalogdb);
Comment thread
Pilchie marked this conversation as resolved.
Outdated

var serviceBus = builder.AddAzureServiceBus("messaging", queueNames: ["orders"]);

Expand Down
70 changes: 25 additions & 45 deletions samples/eShopLite/CatalogService/CatalogContextSeed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ public static async Task InitializeDatabaseAsync(this IServiceProvider servicePr
{
using var scope = serviceProvider.CreateScope();
var dbContext = scope.ServiceProvider.GetRequiredService<CatalogDbContext>();
var delayMs = 1000;
Comment thread
Pilchie marked this conversation as resolved.
Outdated
var retries = 0;
var maxRetryCount = 10;

while (true)
{
try
{
await dbContext.Database.MigrateAsync();
break;
}
catch when (retries < maxRetryCount)
{
await Task.Delay(delayMs);
delayMs *= 2;
}

retries++;
}

await SeedAsync(dbContext);
}

Expand All @@ -36,21 +16,21 @@ private static async Task SeedAsync(CatalogDbContext context)
static List<CatalogBrand> GetPreconfiguredCatalogBrands()
{
return [
new() { Brand = "Azure" },
new() { Brand = ".NET" },
new() { Brand = "Visual Studio" },
new() { Brand = "SQL Server" },
new() { Brand = "Other" }
new() { Id = 0, Brand = "Azure" },
new() { Id = 1, Brand = ".NET" },
new() { Id = 2, Brand = "Visual Studio" },
new() { Id = 3, Brand = "SQL Server" },
new() { Id = 4, Brand = "Other" }
];
}

static List<CatalogType> GetPreconfiguredCatalogTypes()
{
return [
new() { Type = "Mug" },
new() { Type = "T-Shirt" },
new() { Type = "Sheet" },
new() { Type = "USB Memory Stick" }
new() { Id = 0, Type = "Mug" },
new() { Id = 1, Type = "T-Shirt" },
new() { Id = 2, Type = "Sheet" },
new() { Id = 3, Type = "USB Memory Stick" }
];
}

Expand All @@ -64,36 +44,36 @@ static List<CatalogItem> GetPreconfiguredItems(DbSet<CatalogBrand> catalogBrands
var sheet = catalogTypes.First(c => c.Type == "Sheet");

return [
new() { CatalogType = tshirt, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Bot Black Hoodie", Name = ".NET Bot Black Hoodie", Price = 19.5M, PictureFileName = "1.png" },
new() { CatalogType = mug, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Black & White Mug", Name = ".NET Black & White Mug", Price = 8.50M, PictureFileName = "2.png" },
new() { CatalogType = tshirt, CatalogBrand = other, AvailableStock = 100, Description = "Prism White T-Shirt", Name = "Prism White T-Shirt", Price = 12, PictureFileName = "3.png" },
new() { CatalogType = tshirt, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Foundation T-shirt", Name = ".NET Foundation T-shirt", Price = 12, PictureFileName = "4.png" },
new() { CatalogType = sheet, CatalogBrand = other, AvailableStock = 100, Description = "Roslyn Red Sheet", Name = "Roslyn Red Sheet", Price = 8.5M, PictureFileName = "5.png" },
new() { CatalogType = tshirt, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Blue Hoodie", Name = ".NET Blue Hoodie", Price = 12, PictureFileName = "6.png" },
new() { CatalogType = tshirt, CatalogBrand = other, AvailableStock = 100, Description = "Roslyn Red T-Shirt", Name = "Roslyn Red T-Shirt", Price = 12, PictureFileName = "7.png" },
new() { CatalogType = tshirt, CatalogBrand = other, AvailableStock = 100, Description = "Kudu Purple Hoodie", Name = "Kudu Purple Hoodie", Price = 8.5M, PictureFileName = "8.png" },
new() { CatalogType = mug, CatalogBrand = other, AvailableStock = 100, Description = "Cup<T> White Mug", Name = "Cup<T> White Mug", Price = 12, PictureFileName = "9.png" },
new() { CatalogType = sheet, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Foundation Sheet", Name = ".NET Foundation Sheet", Price = 12, PictureFileName = "10.png" },
new() { CatalogType = sheet, CatalogBrand = dotNet, AvailableStock = 100, Description = "Cup<T> Sheet", Name = "Cup<T> Sheet", Price = 8.5M, PictureFileName = "11.png" },
new() { CatalogType = tshirt, CatalogBrand = other, AvailableStock = 100, Description = "Prism White TShirt", Name = "Prism White TShirt", Price = 12, PictureFileName = "12.png" }
new() { Id = 0, CatalogType = tshirt, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Bot Black Hoodie", Name = ".NET Bot Black Hoodie", Price = 19.5M, PictureFileName = "1.png" },
new() { Id = 1, CatalogType = mug, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Black & White Mug", Name = ".NET Black & White Mug", Price = 8.50M, PictureFileName = "2.png" },
new() { Id = 2, CatalogType = tshirt, CatalogBrand = other, AvailableStock = 100, Description = "Prism White T-Shirt", Name = "Prism White T-Shirt", Price = 12, PictureFileName = "3.png" },
new() { Id = 3, CatalogType = tshirt, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Foundation T-shirt", Name = ".NET Foundation T-shirt", Price = 12, PictureFileName = "4.png" },
new() { Id = 4, CatalogType = sheet, CatalogBrand = other, AvailableStock = 100, Description = "Roslyn Red Sheet", Name = "Roslyn Red Sheet", Price = 8.5M, PictureFileName = "5.png" },
new() { Id = 5, CatalogType = tshirt, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Blue Hoodie", Name = ".NET Blue Hoodie", Price = 12, PictureFileName = "6.png" },
new() { Id = 6, CatalogType = tshirt, CatalogBrand = other, AvailableStock = 100, Description = "Roslyn Red T-Shirt", Name = "Roslyn Red T-Shirt", Price = 12, PictureFileName = "7.png" },
new() { Id = 7, CatalogType = tshirt, CatalogBrand = other, AvailableStock = 100, Description = "Kudu Purple Hoodie", Name = "Kudu Purple Hoodie", Price = 8.5M, PictureFileName = "8.png" },
new() { Id = 8, CatalogType = mug, CatalogBrand = other, AvailableStock = 100, Description = "Cup<T> White Mug", Name = "Cup<T> White Mug", Price = 12, PictureFileName = "9.png" },
new() { Id = 9, CatalogType = sheet, CatalogBrand = dotNet, AvailableStock = 100, Description = ".NET Foundation Sheet", Name = ".NET Foundation Sheet", Price = 12, PictureFileName = "10.png" },
new() { Id = 10, CatalogType = sheet, CatalogBrand = dotNet, AvailableStock = 100, Description = "Cup<T> Sheet", Name = "Cup<T> Sheet", Price = 8.5M, PictureFileName = "11.png" },
new() { Id = 11, CatalogType = tshirt, CatalogBrand = other, AvailableStock = 100, Description = "Prism White TShirt", Name = "Prism White TShirt", Price = 12, PictureFileName = "12.png" }
];
}

if (!context.CatalogBrands.Any())
await context.Database.EnsureCreatedAsync();
if (context.CatalogBrands.FirstOrDefault() is null)
{
await context.CatalogBrands.AddRangeAsync(GetPreconfiguredCatalogBrands());

await context.SaveChangesAsync();
}

if (!context.CatalogTypes.Any())
if (context.CatalogTypes.FirstOrDefault() is null)
{
await context.CatalogTypes.AddRangeAsync(GetPreconfiguredCatalogTypes());

await context.SaveChangesAsync();
}

if (!context.CatalogItems.Any())
if (context.CatalogItems.FirstOrDefault() is null)
{
await context.CatalogItems.AddRangeAsync(GetPreconfiguredItems(context.CatalogBrands, context.CatalogTypes));

Expand Down
2 changes: 1 addition & 1 deletion samples/eShopLite/CatalogService/CatalogService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Components\Aspire.Npgsql.EntityFrameworkCore.PostgreSQL\Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.csproj" />
<ProjectReference Include="..\..\..\src\Components\Aspire.Azure.EntityFrameworkCore.CosmosDB\Aspire.Azure.EntityFrameworkCore.CosmosDB.csproj" />
Comment thread
Pilchie marked this conversation as resolved.
Outdated
<ProjectReference Include="..\ServiceDefaults\ServiceDefaults.csproj" />
</ItemGroup>

Expand Down

This file was deleted.

Loading