diff --git a/orleans/ShoppingCart/.dockerignore b/orleans/ShoppingCart/.dockerignore new file mode 100644 index 00000000000..3729ff0cd1a --- /dev/null +++ b/orleans/ShoppingCart/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/orleans/ShoppingCart/.gitignore b/orleans/ShoppingCart/.gitignore index 7023fb37f26..c6b848fd0b6 100644 --- a/orleans/ShoppingCart/.gitignore +++ b/orleans/ShoppingCart/.gitignore @@ -3,6 +3,9 @@ ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +# Publishing package +*.zip + # User-specific files *.suo *.user diff --git a/orleans/ShoppingCart/Abstractions/CartItem.cs b/orleans/ShoppingCart/Abstractions/CartItem.cs index e044f0ce102..d74a37febd3 100644 --- a/orleans/ShoppingCart/Abstractions/CartItem.cs +++ b/orleans/ShoppingCart/Abstractions/CartItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. namespace Orleans.ShoppingCart.Abstractions; @@ -12,4 +12,4 @@ public sealed record class CartItem( [JsonIgnore] public decimal TotalPrice => Math.Round(Quantity * Product.UnitPrice, 2); -} \ No newline at end of file +} diff --git a/orleans/ShoppingCart/Abstractions/GlobalUsings.cs b/orleans/ShoppingCart/Abstractions/GlobalUsings.cs index 8131d4aa6c8..da04a73474f 100644 --- a/orleans/ShoppingCart/Abstractions/GlobalUsings.cs +++ b/orleans/ShoppingCart/Abstractions/GlobalUsings.cs @@ -1,5 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. +global using System.Text.Json.Serialization; global using Orleans.Concurrency; -global using System.Text.Json.Serialization; \ No newline at end of file diff --git a/orleans/ShoppingCart/Abstractions/IInventoryGrain.cs b/orleans/ShoppingCart/Abstractions/IInventoryGrain.cs index b864bdff9b7..a24e9533452 100644 --- a/orleans/ShoppingCart/Abstractions/IInventoryGrain.cs +++ b/orleans/ShoppingCart/Abstractions/IInventoryGrain.cs @@ -4,10 +4,10 @@ namespace Orleans.ShoppingCart.Abstractions; public interface IInventoryGrain : IGrainWithStringKey -{ +{ Task> GetAllProductsAsync(); - + Task AddOrUpdateProductAsync(ProductDetails productDetails); - + Task RemoveProductAsync(string productId); } diff --git a/orleans/ShoppingCart/Abstractions/IShoppingCartGrain.cs b/orleans/ShoppingCart/Abstractions/IShoppingCartGrain.cs index 58f545ce509..daee69591ec 100644 --- a/orleans/ShoppingCart/Abstractions/IShoppingCartGrain.cs +++ b/orleans/ShoppingCart/Abstractions/IShoppingCartGrain.cs @@ -15,7 +15,7 @@ public interface IShoppingCartGrain : IGrainWithStringKey /// Removes the given from the shopping cart. /// Task RemoveItemAsync(ProductDetails product); - + /// /// Gets all the items in the shopping cart. /// @@ -30,4 +30,4 @@ public interface IShoppingCartGrain : IGrainWithStringKey /// Removes all items from the shopping cart. /// Task EmptyCartAsync(); -} \ No newline at end of file +} diff --git a/orleans/ShoppingCart/Abstractions/Orleans.ShoppingCart.Abstractions.csproj b/orleans/ShoppingCart/Abstractions/Orleans.ShoppingCart.Abstractions.csproj index 5bf259b4e12..0727930b7b2 100644 --- a/orleans/ShoppingCart/Abstractions/Orleans.ShoppingCart.Abstractions.csproj +++ b/orleans/ShoppingCart/Abstractions/Orleans.ShoppingCart.Abstractions.csproj @@ -1,13 +1,13 @@ - net7.0 + net8.0 enable enable - + diff --git a/orleans/ShoppingCart/Abstractions/ProductDetails.cs b/orleans/ShoppingCart/Abstractions/ProductDetails.cs index dc6d7879698..6aa40fc15c3 100644 --- a/orleans/ShoppingCart/Abstractions/ProductDetails.cs +++ b/orleans/ShoppingCart/Abstractions/ProductDetails.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. namespace Orleans.ShoppingCart.Abstractions; diff --git a/orleans/ShoppingCart/Grains/GlobalUsings.cs b/orleans/ShoppingCart/Grains/GlobalUsings.cs index 3d9786284ea..83c0bdf92c2 100644 --- a/orleans/ShoppingCart/Grains/GlobalUsings.cs +++ b/orleans/ShoppingCart/Grains/GlobalUsings.cs @@ -3,4 +3,4 @@ global using Orleans.Concurrency; global using Orleans.Runtime; -global using Orleans.ShoppingCart.Abstractions; \ No newline at end of file +global using Orleans.ShoppingCart.Abstractions; diff --git a/orleans/ShoppingCart/Grains/InventoryGrain.cs b/orleans/ShoppingCart/Grains/InventoryGrain.cs index c32f97174af..487095e8837 100644 --- a/orleans/ShoppingCart/Grains/InventoryGrain.cs +++ b/orleans/ShoppingCart/Grains/InventoryGrain.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. using Orleans.Runtime; diff --git a/orleans/ShoppingCart/Grains/Orleans.ShoppingCart.Grains.csproj b/orleans/ShoppingCart/Grains/Orleans.ShoppingCart.Grains.csproj index 433c9c45101..65355524a4e 100644 --- a/orleans/ShoppingCart/Grains/Orleans.ShoppingCart.Grains.csproj +++ b/orleans/ShoppingCart/Grains/Orleans.ShoppingCart.Grains.csproj @@ -1,14 +1,14 @@ - net7.0 + net8.0 enable enable - - + + diff --git a/orleans/ShoppingCart/Grains/ProductGrain.cs b/orleans/ShoppingCart/Grains/ProductGrain.cs index de1a55396ec..459d52915ac 100644 --- a/orleans/ShoppingCart/Grains/ProductGrain.cs +++ b/orleans/ShoppingCart/Grains/ProductGrain.cs @@ -13,10 +13,10 @@ public ProductGrain( storageName: "shopping-cart")] IPersistentState product) => _product = product; - Task IProductGrain.GetProductAvailabilityAsync() => + Task IProductGrain.GetProductAvailabilityAsync() => Task.FromResult(_product.State.Quantity); - Task IProductGrain.GetProductDetailsAsync() => + Task IProductGrain.GetProductDetailsAsync() => Task.FromResult(_product.State); Task IProductGrain.ReturnProductAsync(int quantity) => diff --git a/orleans/ShoppingCart/Grains/ShoppingCartGrain.cs b/orleans/ShoppingCart/Grains/ShoppingCartGrain.cs index 1f75fd37577..5a6a040990e 100644 --- a/orleans/ShoppingCart/Grains/ShoppingCartGrain.cs +++ b/orleans/ShoppingCart/Grains/ShoppingCartGrain.cs @@ -17,7 +17,7 @@ public ShoppingCartGrain( async Task IShoppingCartGrain.AddOrUpdateItemAsync(int quantity, ProductDetails product) { var products = GrainFactory.GetGrain(product.Id); - + int? adjustedQuantity = null; if (_cart.State.TryGetValue(product.Id, out var existingItem)) { diff --git a/orleans/ShoppingCart/README.md b/orleans/ShoppingCart/README.md index 554039ec1d4..2746cc4d128 100644 --- a/orleans/ShoppingCart/README.md +++ b/orleans/ShoppingCart/README.md @@ -55,6 +55,21 @@ The app is architected as follows: 1. `cd orleans-on-app-service` 1. `dotnet run --project Silo\Orleans.ShoppingCart.Silo.csproj` +### Deploying to Azure + +Before deploying to Azure, make sure you complete the following steps: + +1. Create an Azure Cosmos DB for NoSQL account. + 1. Create a database named `Orleans`. + 1. Within the `Orleans` database, create a container named `OrleansStorage` with a partition key path of `/PartitionKey`. + 1. Create another container named `OrleansCluster` within the `Orleans` database. Ensure this container has a partition key path of `/ClusterId`. + 1. Get the connection string. +1. Create an Azure Container App as the target of your deployment. + 1. Ensure that the target ingress port is `8080`. For more information, see [default ASP.NET Core port changed to 8080](https://learn.microsoft.com/dotnet/core/compatibility/containers/8.0/aspnet-port). + 1. Create a secret in the Container App for the Azure Cosmos DB for NoSQL account's connection string. + 1. Create an environment variable in the Container App's container named `ORLEANS_AZURE_COSMOS_DB_CONNECTION_STRING`. Reference the secret you just created. +1. Deploy the application to the Azure Container App service. For more information, see [Azure Container Apps deployment options](https://learn.microsoft.com/azure/container-apps/code-to-cloud-options). + ### Acknowledgements The Orleans.ShoppingCart.Silo project uses the following open3rd party-source projects: diff --git a/orleans/ShoppingCart/Silo/App.razor b/orleans/ShoppingCart/Silo/App.razor index e0d13ccd4b6..8aa9dfc355b 100644 --- a/orleans/ShoppingCart/Silo/App.razor +++ b/orleans/ShoppingCart/Silo/App.razor @@ -1,4 +1,4 @@ - + diff --git a/orleans/ShoppingCart/Silo/Components/ManageProductModal.razor b/orleans/ShoppingCart/Silo/Components/ManageProductModal.razor index 9c71a09ada2..b253b6abe6d 100644 --- a/orleans/ShoppingCart/Silo/Components/ManageProductModal.razor +++ b/orleans/ShoppingCart/Silo/Components/ManageProductModal.razor @@ -20,7 +20,7 @@ Size=Size.Large Disabled=@_isSaving>Bogus Cancel - @if (_isSaving) diff --git a/orleans/ShoppingCart/Silo/Components/PurchasableProductTable.razor b/orleans/ShoppingCart/Silo/Components/PurchasableProductTable.razor index 5719cd74760..2dd3ca6ea90 100644 --- a/orleans/ShoppingCart/Silo/Components/PurchasableProductTable.razor +++ b/orleans/ShoppingCart/Silo/Components/PurchasableProductTable.razor @@ -36,7 +36,7 @@ await AddToCartAsync(product.Id))/> @product.Name diff --git a/orleans/ShoppingCart/Silo/Components/ShoppingCartSummary.razor b/orleans/ShoppingCart/Silo/Components/ShoppingCartSummary.razor index 714c2e286e0..835bd917ae2 100644 --- a/orleans/ShoppingCart/Silo/Components/ShoppingCartSummary.razor +++ b/orleans/ShoppingCart/Silo/Components/ShoppingCartSummary.razor @@ -1,7 +1,7 @@ Cart Summary - + @if (Items is null or { Count: 0 }) diff --git a/orleans/ShoppingCart/Silo/Dockerfile b/orleans/ShoppingCart/Silo/Dockerfile new file mode 100644 index 00000000000..d68a8a4c7b5 --- /dev/null +++ b/orleans/ShoppingCart/Silo/Dockerfile @@ -0,0 +1,26 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER app +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["Silo/Orleans.ShoppingCart.Silo.csproj", "Silo/"] +COPY ["Abstractions/Orleans.ShoppingCart.Abstractions.csproj", "Abstractions/"] +COPY ["Grains/Orleans.ShoppingCart.Grains.csproj", "Grains/"] +RUN dotnet restore "Silo/Orleans.ShoppingCart.Silo.csproj" +COPY . . +WORKDIR "/src/Silo" +RUN dotnet build "Orleans.ShoppingCart.Silo.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +RUN dotnet publish "Orleans.ShoppingCart.Silo.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Orleans.ShoppingCart.Silo.dll"] \ No newline at end of file diff --git a/orleans/ShoppingCart/Silo/Extensions/ProductDetailsExtensions.cs b/orleans/ShoppingCart/Silo/Extensions/ProductDetailsExtensions.cs index ee7cd3907fc..660fbe1e11e 100644 --- a/orleans/ShoppingCart/Silo/Extensions/ProductDetailsExtensions.cs +++ b/orleans/ShoppingCart/Silo/Extensions/ProductDetailsExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. namespace Orleans.ShoppingCart.Silo.Extensions; diff --git a/orleans/ShoppingCart/Silo/GlobalUsings.cs b/orleans/ShoppingCart/Silo/GlobalUsings.cs index 691b489bb1a..e9982a77a4d 100644 --- a/orleans/ShoppingCart/Silo/GlobalUsings.cs +++ b/orleans/ShoppingCart/Silo/GlobalUsings.cs @@ -1,6 +1,8 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. +global using System.Net; +global using System.Security.Claims; global using Bogus; global using Microsoft.AspNetCore.Components; global using MudBlazor; @@ -13,5 +15,3 @@ global using Orleans.ShoppingCart.Silo.Extensions; global using Orleans.ShoppingCart.Silo.Services; global using Orleans.ShoppingCart.Silo.StartupTasks; -global using System.Net; -global using System.Security.Claims; diff --git a/orleans/ShoppingCart/Silo/Orleans.ShoppingCart.Silo.csproj b/orleans/ShoppingCart/Silo/Orleans.ShoppingCart.Silo.csproj index 0c8aef2cdb8..32e8a4ec576 100644 --- a/orleans/ShoppingCart/Silo/Orleans.ShoppingCart.Silo.csproj +++ b/orleans/ShoppingCart/Silo/Orleans.ShoppingCart.Silo.csproj @@ -1,21 +1,24 @@ - net7.0 + net8.0 enable enable false + 98f9767c-ea86-409e-bde7-f6d352a55cce + Linux - - - - - - - - + + + + + + + + + diff --git a/orleans/ShoppingCart/Silo/Pages/Cart.razor b/orleans/ShoppingCart/Silo/Pages/Cart.razor index fdf4f408997..39e1680a539 100644 --- a/orleans/ShoppingCart/Silo/Pages/Cart.razor +++ b/orleans/ShoppingCart/Silo/Pages/Cart.razor @@ -3,7 +3,7 @@ Shopping Cart - Empty Cart diff --git a/orleans/ShoppingCart/Silo/Pages/Products.razor.cs b/orleans/ShoppingCart/Silo/Pages/Products.razor.cs index 85063553d85..65020ab7168 100644 --- a/orleans/ShoppingCart/Silo/Pages/Products.razor.cs +++ b/orleans/ShoppingCart/Silo/Pages/Products.razor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. using Orleans.ShoppingCart.Silo.Components; @@ -20,7 +20,7 @@ public sealed partial class Products public ProductService ProductService { get; set; } = null!; [Inject] - public IDialogService DialogService { get; set; } = null!; + public IDialogService DialogService { get; set; } = null!; protected override async Task OnInitializedAsync() => _products = await InventoryService.GetAllProductsAsync(); diff --git a/orleans/ShoppingCart/Silo/Pages/Shop.razor.cs b/orleans/ShoppingCart/Silo/Pages/Shop.razor.cs index fbe93981040..2c504c8e07a 100644 --- a/orleans/ShoppingCart/Silo/Pages/Shop.razor.cs +++ b/orleans/ShoppingCart/Silo/Pages/Shop.razor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. namespace Orleans.ShoppingCart.Silo.Pages; diff --git a/orleans/ShoppingCart/Silo/Program.cs b/orleans/ShoppingCart/Silo/Program.cs index f1462c46c35..8fd7ee1f15a 100644 --- a/orleans/ShoppingCart/Silo/Program.cs +++ b/orleans/ShoppingCart/Silo/Program.cs @@ -1,43 +1,63 @@ -// Copyright (c) Microsoft. All rights reserved. +// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT License. -await Host.CreateDefaultBuilder(args) - .UseOrleans( - (context, builder) => +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddMudServices(); +builder.Services.AddRazorPages(); +builder.Services.AddServerSideBlazor(); +builder.Services.AddHttpContextAccessor(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddScoped(); +builder.Services.AddSingleton(); +builder.Services.AddLocalStorageServices(); + +if (builder.Environment.IsDevelopment()) +{ + builder.Host.UseOrleans((_, builder) => + { + builder + .UseLocalhostClustering() + .AddMemoryGrainStorage("shopping-cart") + .AddStartupTask(); + }); +} +else +{ + builder.Host.UseOrleans((context, builder) => + { + var connectionString = context.Configuration["ORLEANS_AZURE_COSMOS_DB_CONNECTION_STRING"]!; + + builder.Configure(options => { - if (context.HostingEnvironment.IsDevelopment()) - { - builder.UseLocalhostClustering() - .AddMemoryGrainStorage("shopping-cart") - .AddStartupTask(); - } - else - { - var endpointAddress = - IPAddress.Parse(context.Configuration["WEBSITE_PRIVATE_IP"] ?? ""); - var strPorts = - (context.Configuration["WEBSITE_PRIVATE_PORTS"] ?? "").Split(','); - if (strPorts.Length < 2) - throw new Exception("Insufficient private ports configured."); - var (siloPort, gatewayPort) = - (int.Parse(strPorts[0]), int.Parse(strPorts[1])); - var connectionString = - context.Configuration["ORLEANS_AZURE_STORAGE_CONNECTION_STRING"]; - - builder - .ConfigureEndpoints(endpointAddress, siloPort, gatewayPort) - .Configure( - options => - { - options.ClusterId = "ShoppingCartCluster"; - options.ServiceId = nameof(ShoppingCartService); - }).UseAzureStorageClustering( - options => options.ConfigureTableServiceClient(connectionString)); - builder.AddAzureTableGrainStorage( - "shopping-cart", - options => options.ConfigureTableServiceClient(connectionString)); - } - }) - .ConfigureWebHostDefaults( - webBuilder => webBuilder.UseStartup()) - .RunConsoleAsync(); \ No newline at end of file + options.ClusterId = "ShoppingCartCluster"; + options.ServiceId = nameof(ShoppingCartService); + }); + + builder + .UseCosmosClustering(o => o.ConfigureCosmosClient(connectionString)) + .AddCosmosGrainStorage("shopping-cart", o => o.ConfigureCosmosClient(connectionString)); + }); +} + +var app = builder.Build(); + +if (app.Environment.IsDevelopment()) +{ + app.UseDeveloperExceptionPage(); +} +else +{ + app.UseExceptionHandler("/Error"); + app.UseHsts(); +} + +app.UseHttpsRedirection(); +app.UseStaticFiles(); +app.UseRouting(); +app.MapBlazorHub(); +app.MapFallbackToPage("/_Host"); + +await app.RunAsync(); diff --git a/orleans/ShoppingCart/Silo/Services/ShoppingCartService.cs b/orleans/ShoppingCart/Silo/Services/ShoppingCartService.cs index 4efcce02a86..eb5294f7df7 100644 --- a/orleans/ShoppingCart/Silo/Services/ShoppingCartService.cs +++ b/orleans/ShoppingCart/Silo/Services/ShoppingCartService.cs @@ -23,7 +23,7 @@ public Task GetCartCountAsync() => public Task EmptyCartAsync() => TryUseGrain( - cart => cart.EmptyCartAsync(), + cart => cart.EmptyCartAsync(), () => Task.CompletedTask); public Task AddOrUpdateItemAsync(int quantity, ProductDetails product) => diff --git a/orleans/ShoppingCart/Silo/Shared/MainLayout.razor.cs b/orleans/ShoppingCart/Silo/Shared/MainLayout.razor.cs index 0fa2d6e2fc5..778a7118905 100644 --- a/orleans/ShoppingCart/Silo/Shared/MainLayout.razor.cs +++ b/orleans/ShoppingCart/Silo/Shared/MainLayout.razor.cs @@ -8,17 +8,17 @@ namespace Orleans.ShoppingCart.Silo.Shared; public partial class MainLayout { const string PrefersDarkThemeKey = "prefers-dark-scheme"; - + readonly MudTheme _theme = new() { - Palette = new Palette() + Palette = new PaletteLight() { Tertiary = "#7e6fff", DrawerIcon = "#aaa9b9", DrawerText = "#aaa9b9", DrawerBackground = "#303030" }, - PaletteDark = new Palette() + PaletteDark = new PaletteDark() { Primary = "#7e6fff", Tertiary = "#7e6fff", @@ -85,7 +85,7 @@ Task OnToastRequested((string Title, string Message) tuple) => var (_, message) = tuple; Snackbar.Add( - message, + message, MudSeverity.Success, options => options.CloseAfterNavigation = true); }); diff --git a/orleans/ShoppingCart/Silo/Shared/NavMenu.razor b/orleans/ShoppingCart/Silo/Shared/NavMenu.razor index 5b5ae6bf607..63d094b74ad 100644 --- a/orleans/ShoppingCart/Silo/Shared/NavMenu.razor +++ b/orleans/ShoppingCart/Silo/Shared/NavMenu.razor @@ -1,10 +1,10 @@ @inject ShoppingCartService Cart - Home - Shop Inventory - Product Management - + Home + Shop Inventory + Product Management + Cart diff --git a/orleans/ShoppingCart/Silo/Startup.cs b/orleans/ShoppingCart/Silo/Startup.cs deleted file mode 100644 index 04909da18a1..00000000000 --- a/orleans/ShoppingCart/Silo/Startup.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT License. - -namespace Orleans.ShoppingCart.Silo; - -public sealed class Startup -{ - public void ConfigureServices(IServiceCollection services) - { - services.AddMudServices(); - services.AddRazorPages(); - services.AddServerSideBlazor(); - services.AddHttpContextAccessor(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddScoped(); - services.AddSingleton(); - services.AddLocalStorageServices(); - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - else - { - app.UseExceptionHandler("/Error"); - app.UseHsts(); - } - - app.UseHttpsRedirection(); - app.UseStaticFiles(); - app.UseRouting(); - - app.UseEndpoints(endpoints => - { - endpoints.MapBlazorHub(); - endpoints.MapFallbackToPage("/_Host"); - }); - } -} \ No newline at end of file diff --git a/orleans/ShoppingCart/Silo/StartupTasks/SeedProductStoreTask.cs b/orleans/ShoppingCart/Silo/StartupTasks/SeedProductStoreTask.cs index 3663ce92ff9..d7635ca695c 100644 --- a/orleans/ShoppingCart/Silo/StartupTasks/SeedProductStoreTask.cs +++ b/orleans/ShoppingCart/Silo/StartupTasks/SeedProductStoreTask.cs @@ -11,7 +11,7 @@ public SeedProductStoreTask(IGrainFactory grainFactory) => _grainFactory = grainFactory; async Task IStartupTask.Execute(CancellationToken cancellationToken) - { + { var faker = new ProductDetails().GetBogusFaker(); foreach (var product in faker.GenerateLazy(50))