You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✨ Migrate from Minimal APIs to FastEndpoints (#198)
This pull request introduces FastEndpoints as the primary API framework
for the SSW.VerticalSliceArchitecture template, replacing the previous
Minimal APIs approach. It updates dependencies, refactors infrastructure
and endpoint code to align with FastEndpoints 7.0, and documents the
architectural decision and build status. The changes ensure improved
structure, maintainability, and developer productivity while maintaining
compatibility with existing domain patterns and event handling via
MediatR.
**Architectural Documentation and Guidelines:**
* Added comprehensive Copilot instructions for creating ADRs in
`.github/instructions/adrs.instructions.md`, detailing file naming,
structure, content guidelines, and project-specific conventions.
* Added a new ADR
(`docs/adrs/20251018-api-use-fastendpoints-instead-of-minimal-apis.md`)
documenting the decision to adopt FastEndpoints over Minimal APIs,
including context, drivers, options, outcomes, and consequences.
**Dependency and Infrastructure Updates:**
* Updated `Directory.Packages.props` to add FastEndpoints (`7.0.0`) and
FastEndpoints.Swagger as dependencies, ensuring the project uses the
latest version and supports OpenAPI documentation.
[[1]](diffhunk://#diff-5baf5f9e448ad54ab25a091adee0da05d4d228481c9200518fcb1b53a65d4156R6)
[[2]](diffhunk://#diff-5baf5f9e448ad54ab25a091adee0da05d4d228481c9200518fcb1b53a65d4156R24)
**Implementation and Code Refactoring:**
* Refactored infrastructure and endpoint files to use FastEndpoints 7.0
API, including updating processors to global interfaces, removing
FastEndpoints event handler, and changing response handling to direct
`HttpContext.Response` usage.
* Updated event handling to route domain events exclusively through
MediatR, removing incompatible FastEndpoints event publishing and
handlers.
**Documentation of Build and Implementation Status:**
* Added a detailed build success report in
`docs/cli-tasks/BUILD_SUCCESS.md`, summarizing the changes, current
implementation, testing instructions, and known limitations of the
FastEndpoints integration.
@@ -6,10 +6,10 @@ This is an enterprise-ready Vertical Slice Architecture template for .NET 9 with
6
6
## Architecture Patterns
7
7
8
8
### Vertical Slice Organization
9
-
-**Features**: `src/WebApi/Features/{FeatureName}/` contains Commands, Queries, and a `{FeatureName}Feature.cs` implementing `IFeature`
10
-
-**Commands/Queries**: Each is a static class containing nested `Request`, `Handler`, `Validator`, and `Endpoint` classes
11
-
-**Handlers**: Always named `Handler` (enforced by architecture tests in `tests/WebApi.ArchitectureTests/`)
12
-
-**Endpoints**: Implement `IEndpoint` with `MapEndpoint(IEndpointRouteBuilder)` - auto-discovered via reflection in `Host/EndpointDiscovery.cs`
9
+
-**Features**: `src/WebApi/Features/{FeatureName}/` contains Endpoints and a `{FeatureName}Feature.cs` implementing `IFeature`
10
+
-**Endpoints**: Located in `Features/{FeatureName}/Endpoints/` - each endpoint is a separate file inheriting from `Endpoint<TRequest, TResponse>` or `EndpointWithoutRequest<TResponse>`
11
+
-**Endpoint Discovery**: FastEndpoints automatically discovers and registers all endpoints at startup
12
+
-**Groups**: Each feature defines a `Group` class to configure routing prefix and shared settings (e.g., `HeroesGroup` for `/api/heroes`)
13
13
14
14
### Domain Layer (`Common/Domain/`)
15
15
-**Entities**: Inherit from `Entity<TId>` or `AggregateRoot<TId>` for domain events
@@ -24,16 +24,119 @@ This is an enterprise-ready Vertical Slice Architecture template for .NET 9 with
24
24
- Apply with `.WithSpecification(new YourSpec())` on DbSet queries
0 commit comments