Version 10.0 is a fresh start. It includes new features and improvements, plus architectural refactoring for better performance and maintainability.
The template has been refactored to provide an out-of-the-box experience. Key themes: simplification and standardization. We remove specific patterns and habits, adopting mainstream approaches for most scenarios.
Ater.Web.Core and Ater.Web.Convention into Ater.AspNetCore; removed non-essentials.Ater.Web.Extensions to Ater.AspNetCore.ToolKit as an optional package (no longer default).Previously, separate CommandDbContext and QueryDbContext increased mental overhead and didn't handle mixed scenarios well.
Now, one DefaultDbContext serves as the primary data access layer. For read-only contexts, inherit ReadonlyDbContext.
ManagerBase is now lighter and more flexible. As an abstract class, inherit it regardless of data needs.
ManagerBase<TDbContext, TEntity> methods are optimized. See Manager Business Logic.
Templates support multi-language out of the box. Generated controllers inject Localizer for string localization.
Source generators auto-create constants from resource files.
With Aspire maturing, templates now treat it as a core dependency. Explore and extend it throughout development.
Use Aspire integration packages; cache and DB gain observability by default.
Docs provide examples for different scenarios.
GlobalExceptionMiddleware handles exceptions uniformly. Add custom logic as needed.
Generated endpoints follow RESTful standards.
| Operation | HTTP | Status | Notes |
|---|---|---|---|
| Filter | POST | 200 | Now GET |
| Add | POST | 200 | Now 201 |
| Update | PUT | 200 | Returns updated entity |
| Delete | DELETE | 200 | Now 204 |
For simple add/update/delete operations, execute SQL directly instead of querying first. Judge existence by result.
Note
Complex logic (permissions, preconditions) still requires queries first.
See Cache Operations.
Primary change: Microsoft.OpenApi package and OpenAPI spec upgrade to 3.1.0.
Now for simple add/update/delete operations, by default, data is no longer queried first, but relevant SQL operations are executed directly, and whether relevant data exists is judged based on the return result.
Note
For more complex logic, you still need to query first, such as some permission judgments, preconditions, etc.
The main impact is the Microsoft.OpenApi package, and the OpenApi specification version upgrade to 3.1.0.
ĺ 厚大纲