Class GeneratedMediatorAttribute
- Namespace
- Mediarion
- Assembly
- Mediarion.dll
Marks a partial class for the generator to implement IMediator on.
[AttributeUsage(AttributeTargets.Class)]
public sealed class GeneratedMediatorAttribute : Attribute
- Inheritance
-
GeneratedMediatorAttribute
- Inherited Members
Remarks
Mediator works out which handler answers a request while the program runs, which means closing a generic over a type it only learns then. That cannot be done in an application published ahead of time. A class marked with this gets the same dispatch written out as ordinary C# instead, one case per request, settled while the project compiles.
The class needs a constructor taking an IServiceProvider, and the generator writes it. Everything else — the handlers, the behaviours, the processors — is the same code either way.
Properties
- RegisterRequestProcessors
Gets or sets whether the generated registration also registers the pre- and post-processors it found. Off by default.