-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The first thing you'll want to do is register the service and the middleware:
DO NOT manually register IHowlerStructure
or IHowlerWhisper
!
Whisper allow to call methods on other services without having to pull them as dependencies, whilst being able to use the DI to fulfil the Whisper dependencies.
Create a class that implements IHowlerWhisper
(remember, do not register it!):
And to use the service, simply inject the IHowler in your services and call the _howler.Whisper<T>
methods to invoke your whisper, where T is the type of the Whisper:
Structures add another level of abstraction on top of the Whispers, by entirely encapsulating the Structures, and retrieving them by passing an Id to the Howler.
Similarly to the Whisper, create a class that implements from IHowlerStructure
. Implement the required method and inside, register your structures with a corresponding id (remember, do not register it!):
and then use it as so: