Notices
Last updated
Last updated
Structr.Notices package is intended to help organize notification dispatching in application.
Notices package is available on NuGet.
Configure notice services:
AddNotices()
extension method performs registration of notice publisher service INoticePublisher
and notice handlers implementing INoticeHandler
or inherited from NoticeHandler
class.
Param name | Param type | Description |
---|---|---|
Additionally configure INoticePublisher
service by specifying it's type and lifetime used NoticeServiceOptions
.
NoticeServiceOptions
properties:
Property name | Property type | Description |
---|---|---|
The main difference from Structr.Operations package is that notice can handling by any of handlers while operation can handling by only one handler.
The basic usage is:
Create a notice class that inherits from INotice
:
Create a notice handlers class that inherits from INoticeHandler
or NoticeHandler
:
The last step is to inject INoticePublisher
service and use it:
Inherit from NoticeHandler
class when you need synchronic-manner handler.
assembliesToScan
params Assembly[]
List of assemblies to search notice handlers.
configureOptions
Action<NoticeServiceOptions>
Options to be used by notices handling service.
PublisherServiceType
Type
Changes standard implementation of INoticePublisher
to specified one. Default value is typeof(NoticePublisher)
.
PublisherServiceLifetime
ServiceLifetime
Specifies the lifetime of an INoticePublisher
service. Default value is Transient
.