Version 2.0.0 is a significant release that modernises ServiceComposer’s integration with ASP.NET Core. The legacyDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ServiceComposer/ServiceComposer.AspNetCore/llms.txt
Use this file to discover all available pages before exploring further.
RunCompositionGateway host API, route-builder extension points, and all v1 composition interfaces have been replaced with first-class ASP.NET Core endpoint routing and a new, consistent handler API. Follow the steps below to bring your application up to date.
Update target frameworks
Starting with v2.0.0,
ServiceComposer.AspNetCore targets only net6.0 and net7.0. Ensure your project targets one of these frameworks before proceeding.Replace RunCompositionGateway with MapCompositionHandlers
The
RunCompositionGateway API is deprecated. Replace it with explicit ASP.NET Core endpoint configuration using UseRouting and UseEndpoints:Extending
IRouteBuilder to map custom routes is no longer supported. Use routing attributes on composition handlers instead (see the steps below).Replace IHandleRequests with ICompositionRequestsHandler
The
IHandleRequests interface has been replaced by ICompositionRequestsHandler. Implement the new interface and annotate the handler method with an HTTP routing attribute (HttpGet, HttpPost, etc.) in place of the old IInterceptRoutes.Matches method:Replace ISubscribeToCompositionEvents with ICompositionEventsSubscriber
The
ISubscribeToCompositionEvents interface has been replaced by ICompositionEventsSubscriber. Implement the new interface and use routing attributes to declare which routes the subscriber participates in:Replace IHandleRequestsErrors with ICompositionErrorsHandler
The
IHandleRequestsErrors interface has been replaced by ICompositionErrorsHandler:Update ICompositionContext usage
DynamicViewModel no longer implements ICompositionContext. Retrieve the composition context from the current HttpRequest:Update IViewModelPreviewHandler implementations
In v2.0.0,
IViewModelPreviewHandler exposes a single Preview(HttpRequest httpRequest) overload. Ensure any implementation matches this signature:Enable write support (POST, PUT, PATCH, DELETE)
By default, ServiceComposer v2.0.0 responds only to HTTP
GET requests. To handle write requests, opt in via configuration:In v2.1.0 write support became enabled by default. If you are upgrading directly to v2.1.0 or later, you no longer need to call
EnableWriteSupport().