Releases: SamhammerAG/Samhammer.DependencyInjection
8.0.1
8.0.0
6.1.1
6.1.0
New features
Overrides
It is now possible to have overrides by adding the "Samhammer.DependencyInjection.Override" package.
See readme for further details.
Type resolving
Added new extension point to change how types and matching interfaces are found.
Implement ITypeResolvingStrategy and use options.SetTypeStrategy to set your override.
Methods:
- ResolveTypesByAttribute = Implement how types are found by DependencyInjectionAttribute
- GetMatchingInterfaceType = Implement logic to find a matching interface in "Target.Matching" mode. (e.g. for custom naming schemas)
BREAKING CHANGES
Signature changes
If you have a custom provider or custom handlers, you have to change the constructor to:
- InjectMatchingServiceDescriptorHandler(DependencyResolverOptions options)
- InjectAsServiceDescriptorHandler()
- InjectAllServiceDescriptorHandler()
- FactoryServiceDescriptorHandler()
- AttributeServiceDescriptorProvider(ILogger logger, DependencyResolverOptions options)
Adding assembly strategy
The name of the extension method to add an assembly strategy changed from
serviceCollection.ResolveDependencies(options => options.SetStrategy(assemblyResolvingStrategy));
to
serviceCollection.ResolveDependencies(options => options.SetAssemblyStrategy(assemblyResolvingStrategy));
3.1.6.0
New features
Overrides
It is now possible to have overrides by adding the "Samhammer.DependencyInjection.Override" package.
See readme for further details.
Type resolving
Added new extension point to change how types and matching interfaces are found.
Implement ITypeResolvingStrategy and use options.SetTypeStrategy to set your override.
Methods:
- ResolveTypesByAttribute = Implement how types are found by DependencyInjectionAttribute
- GetMatchingInterfaceType = Implement logic to find a matching interface in "Target.Matching" mode. (e.g. for custom naming schemas)
BREAKING CHANGES
Signature changes
If you have a custom provider or custom handlers, you have to change the constructor to:
- InjectMatchingServiceDescriptorHandler(DependencyResolverOptions options)
- InjectAsServiceDescriptorHandler()
- InjectAllServiceDescriptorHandler()
- FactoryServiceDescriptorHandler()
- AttributeServiceDescriptorProvider(ILogger logger, DependencyResolverOptions options)
Adding assembly strategy
The name of the extension method to add an assembly strategy changed from
serviceCollection.ResolveDependencies(options => options.SetStrategy(assemblyResolvingStrategy));
to
serviceCollection.ResolveDependencies(options => options.SetAssemblyStrategy(assemblyResolvingStrategy));
6.0.0
- update for dotnet 6.0
3.1.5.2
3.1.5.1
Enhancements
- The exception messages provide more informations
BREAKING CHANGES
- The registration of custom IAssemblyResolvingStrategy has been changed from IServiceCollection to options container (see also README)
services.ResolveDependencies(options => options.SetStrategy(new MyAssemblyResolvingStrategy())); - The registration of custom IServiceDescriptorProvider has been changed from IServiceCollection to options container (see also README)
services.ResolveDependencies(options => options.AddProvider((logger, strategy) => new MyServiceDescriptorProvider(logger, strategy))); - The usage of logging has been changed from IServiceCollection to options container and is deactivated by default (see also README)
3.1.4
3.1.3
update microsoft packages to 3.1.3