ServiceComposer.AspNetCore

Upgrade guide from v2.x to 3.0.0

Contents

Use Endpoints and route attributes

The following route mapping methods have been removed:

Use attribute routing based composition, MapCompositionHandlers and MVC Endpoints as described in the getting started section.

THe following types and members have been removed:

See the ASP.Net Core endopints integration for further details on the available replacement options.

The CompositionGateway has been removed, use the host intergration and MVC Endpoints.

Composed request ID

The AddComposedRequestIdHeader, GetComposedRequestId, and GetComposedRequestIdHeaderOr have been removed in favor of accessing the request identifier trhough the composition context. To get the composition context in a composition handler:

var context = request.GetCompositionContext();

snippet source | anchor

The composition context exposes the RequestID property:

var requestId = context.RequestId;

snippet source | anchor

ViewModel Preview

Two IViewModelPreviewHandler.Preview overloads have been removed. Use IViewModelPreviewHandler.Preview(HttpRequest request).

Write support

Write support is enabled by default and can be disabled using the DisableWriteSupport() configuration option. The EnableWriteSupport() method hae been removed in v3.

Raise event using the composition context instead of the ViewModel

The dynamic vm.RaiseEvent() method has been removed. To raise events, access the composition context and use the RaiseEvent method:

await context.RaiseEvent(new AnEvent());

snippet source | anchor