ASP.NET Core 10.0, part of the broader .NET 10 release, introduces several new features and enhancements. The key focus areas include improvements to Blazor, OpenAPI support, and Minimal APIs, along with enhanced security and performance.

1. Blazor Enhancements
Blazor WebAssembly Performance: ASP.NET Core 10.0 includes significant performance optimizations for Blazor WebAssembly, such as preloading static assets to improve startup times and enhanced diagnostics for performance profiling.
Form Validation: The new release offers improved form validation, including full-object graph validation, which allows for more complex and robust validation logic.
State Persistence: Blazor Server now includes features for persistent component state, which improves resilience and scalability.
QuickGrid: The QuickGrid component has been updated with new features like
RowClassfor conditional styling and improved navigation that prevents unwanted page scrolling on same-page updates.Blazor
QuickGridRowClassThe new
RowClassparameter on the BlazorQuickGridcomponent allows for easy conditional styling of rows. This simplifies UI logic, moving it from CSS selectors to C# code.
HTML
<QuickGrid Items="items" RowClass="GetRowCssClass">
<PropertyColumn Property="@(p => p.Name)" Title="Name" />
<PropertyColumn Property="@(p => p.IsArchived)" Title="Archived" />
</QuickGrid>
@code {
private string GetRowCssClass(MyGridItem item)
{
return item.IsArchived ? "archived-row" : null;
}
}2. OpenAPI & Minimal APIs
OpenAPI 3.1 Support: ASP.NET Core 10.0 provides full support for OpenAPI 3.1, allowing for more comprehensive API documentation. This includes compliance with the JSON Schema draft 2020-12 and the ability to serve OpenAPI documents in YAML format.
Minimal API Validation: Built-in support for validation is now available in Minimal APIs. This allows you to define validation rules using
DataAnnotationsattributes on parameters and models, with the runtime automatically returning a 400 Bad Request response on failure.Simplified API Development: Minimal APIs have been further enhanced to make building lightweight web services even easier. A new feature allows you to inject services into minimal APIs without needing the
[FromServices]attribute.app.MapPost("/person", ([Validate] Person person) => { // The framework handles validation. This code only runs if the person object is valid. return Results.Created($"/person/{person.Id}", person); }); public record Person( [Required] int Id, [StringLength(50)] string Name, [EmailAddress] string Email ); // Old way (pre-10.0) app.MapGet("/users", ([FromServices] IUserService userService) => { return userService.GetAllUsers(); }); // New way (10.0) app.MapGet("/users", (IUserService userService) => { return userService.GetAllUsers(); });

Join the conversation! Your thoughts help the community grow.