ServiceComposer leverages the Endpoints support to plugin into the request handling pipeline. ServiceComposer can be added to existing or new ASP.NET Core projects, or it can be hosted in .NET console applications.
ServiceComposer targets .NET 8.
If resources are shared across more than one handler they must be thread-safe.
Upgrade guides are available to ease the migration from one version to another.
When handling composition requests it possible to leverage the power of ASP.Net Model Binding to bind incoming forms, bodies, query string parameters, or route data to strongly typed C# models. For more information on model binding refer to the Model Binding section.
MVC Action results support allow composition handlers to set custom response results for specific scenarios, like for example, handling bad requests or validation error that would normally require throwing an exception. For more information on action results refer to the MVC Action results section.
By virtue of leveraging ASP.NET Core 3.x Endpoints ServiceComposer automatically supports authentication and authorization metadata attributes to express authentication and authorization requirements on routes. For more information refer to the Authentication and Authorization section
By default ServiceComposer serializes responses using the Newtonsoft JSON serializer. The built-in serialization support can be configured to serialize responses using a camel case or pascal case approach on a per request basis by adding to the request an Accept-Casing
custom HTTP header. For more information refer to the response serialization casing section. Or it's possible to take full control over the response serialization settings on a case-by-case by supplying at configuration time a customization function.
Starting with version 1.9.0, regular MVC Output Formatters can be used to serialize the response model, and honor the Accept
HTTP header set by clients. When using output formatters the serialization casing is controlled by the formatter configuration and not by ServiceComposer. For more information on using output formatters refers to the output formatters serialization section.
It's possible to access and customize ViewModel Composition options at application start-up by defining types implementing the IViewModelCompositionOptionsCustomization
interface.
Endpoint filters allow intercepting all incoming HTTP requests before they reach the composition stage. For more information refer to the endpoint filters documentation.
Composition requests filters allow intercepting compostion requests before they are dispatched to composition handlers. For more information refer to the Composition requests filters documentation.