Repository navigation
Releases: AyrA/AutoDI
Release list
Streamlined service registration
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
.NET 8 + Hosted Services
New in this version
- .NET 8
- Streamlined Attribute usage
- Support for hosted services
Attribute Changes
More constructors were added to the AutoDIRegisterAttribute attribute to make usage easier. You no longer have to define the service type when using a custom registration function.
Hosted Services
Hosted services can now be registered automatically using the AutoDIHostedServiceAttribute attribute.
For this to work, your class must implement Microsoft.Extensions.Hosting.IHostedService or an exception will be thrown.
Added support for custom registration functions
You can now specify your own registration function in the attribute to override the defaults. See readme file for details.
This change should not interfer with existing installations of v2.0 or later.
Better assembly searcher
The assembly type searcher has been improved. It can now search assemblies that are referenced, but not yet loaded.
To stop it from loading the entire .NET framework into memory, internal assemblies starting with "Microsoft." or "System." are excluded by default.
Multiple Attribute support added
This version adds the ability for you to specify the injection attribute multiple times on the same type.
Doing so will inject the type multiple times. You can use this to register a type with multiple interfaces for example.
Signed package
No changes in code. But the package is signed now
First publish
v1.0.0 Change project to allow publishing to nuget