Skip to content

Streamlined service registration

Latest

Choose a tag to compare

@AyrA AyrA released this 20 Jul 03:02
· 1 commit to master since this release

New AutoDIHostedSingletonService attribute

This attribute registers a service as a singleton and hosted service simultaneously. Both registrations will use the same instance.

This replaces the need for custom registration code whenever a service is to be used as a hosted service as well as a singleton at the same time.

New filters

You can now define filters for each AutoDI* attribute. The filters are compared against those in AutoDIExtensions.FilterList to dynamically decide which service to load and which to skip. Filters can be used to either explicitly include, or explicitly exclude services.
Services without a filter are always loaded to retain existing behavior. The details on how the filters work is explained in the readme file.

Removed: throwOnNoneType argument, and AutoDIType.None enum value

These are no longer needed and can be replaced using the new filter system