Skip to content

Releases: SamhammerAG/Samhammer.DependencyInjection

8.0.1

08 Sep 09:02
Compare
Choose a tag to compare

update Microsoft.Extensions.DependencyModel to 8.0.2
this updates transitive System.Text.Json to 8.0.5

8.0.0

08 Mar 09:09
f65a066
Compare
Choose a tag to compare
  • Dotnet8

6.1.1

12 Apr 08:40
67e9bdc
Compare
Choose a tag to compare

New features

Decorate support

It is now possible to use the decorate pattern on a injected service via extension method

Methods:

  • serviceCollection.Decorate<TInterface, TDecorator>()

6.1.0

27 Jan 09:56
9394e1e
Compare
Choose a tag to compare

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

27 Jan 12:24
3d3f32f
Compare
Choose a tag to compare

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

20 Jan 12:36
9c7c2bd
Compare
Choose a tag to compare
  • update for dotnet 6.0

3.1.5.2

27 Jan 12:23
Compare
Choose a tag to compare
  • add overload for ResolveDependencies with old signature for compatibility

3.1.5.1

01 Oct 15:28
Compare
Choose a tag to compare

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

12 Aug 13:30
Compare
Choose a tag to compare

Update dependencies to latest version

3.1.3

28 Apr 14:16
Compare
Choose a tag to compare

update microsoft packages to 3.1.3