diff --git a/blazor/common/authentication/blazor-microsoft-entra-id.md b/blazor/common/authentication/blazor-microsoft-entra-id.md index 5dade60d4..53a33a7b4 100644 --- a/blazor/common/authentication/blazor-microsoft-entra-id.md +++ b/blazor/common/authentication/blazor-microsoft-entra-id.md @@ -13,7 +13,7 @@ This guide shows how to secure the [Syncfusion® Blazor DataGrid](https://www.sy ## Create a Blazor project -If you already have a Blazor project configured, you can skip this section and proceed to **Install required packages**. +If you already have a Blazor project configured, you can skip this section and proceed to [Install required packages](../authentication/blazor-microsoft-entra-id#install-required-packages). Otherwise, create a new Blazor application by following the [Syncfusion® getting started guide](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app) for a **Blazor Web App (Interactive Server)**. @@ -67,17 +67,17 @@ Include the theme stylesheet and script references in the `App.razor` file. {% highlight razor tabtitle="App.razor" %} - .... + .... - .... + .... - .... + .... - .... + .... {% endhighlight %} @@ -147,7 +147,7 @@ using Syncfusion.Blazor; var builder = WebApplication.CreateBuilder(args); -// Configure authentication with Microsoft Entra ID (Azure AD) +// Configure authentication with Microsoft Entra ID (Azure AD). builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme) .AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAd")); @@ -156,10 +156,10 @@ builder.Services.AddAuthorization(); builder.Services.AddRazorComponents() .AddInteractiveServerComponents(); -// Register the Syncfusion® Blazor service +// Register the Syncfusion® Blazor service. builder.Services.AddSyncfusionBlazor(); -// Add controllers with UI endpoints for Microsoft Identity (SignIn/SignOut) +// Add controllers with UI endpoints for Microsoft Identity (SignIn/SignOut). builder.Services.AddControllersWithViews().AddMicrosoftIdentityUI(); var app = builder.Build(); @@ -236,24 +236,25 @@ Create a protected page that displays the **Syncfusion® Blazor DataGrid** only Logout - + - - - + + + + - @code { - public List Orders { get; set; } = new List(); + @code{ + public List Orders { get; set; } protected override void OnInitialized() { - var customerIds = new[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" }; - Orders = Enumerable.Range(1, 5).Select(x => new Order - { - OrderID = x, - CustomerID = customerIds[Random.Shared.Next(5)] + Orders = Enumerable.Range(1, 12).Select(i => new Order { + OrderID = 1000 + i, + CustomerID = new[] { "ALFKI","ANATR","ANTON","BLONP","BOLID" }[Random.Shared.Next(5)], + OrderDate = DateTime.Today.AddDays(-i), + Freight = Math.Round(25 + 15 * Random.Shared.NextDouble(), 2) }).ToList(); } @@ -261,6 +262,8 @@ Create a protected page that displays the **Syncfusion® Blazor DataGrid** only { public int OrderID { get; set; } public string? CustomerID { get; set; } + public DateTime OrderDate { get; set; } + public double Freight { get; set; } } } diff --git a/blazor/common/authentication/images/blazor-datagrid-microsoftentraid.webp b/blazor/common/authentication/images/blazor-datagrid-microsoftentraid.webp index 75f005688..3fc7e8f0e 100644 Binary files a/blazor/common/authentication/images/blazor-datagrid-microsoftentraid.webp and b/blazor/common/authentication/images/blazor-datagrid-microsoftentraid.webp differ