Skip to content

Releases: SamhammerAG/Samhammer.DependencyInjection

10.0.0

Choose a tag to compare

@datlam162 datlam162 released this 15 Jan 06:36
5754dbe

Update dotnet 10

8.0.1

Choose a tag to compare

@agentschmitt agentschmitt released this 08 Sep 09:02

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

8.0.0

Choose a tag to compare

@devRoemer devRoemer released this 08 Mar 09:09
f65a066
  • Dotnet8

6.1.1

Choose a tag to compare

@fkuehnSAG fkuehnSAG released this 12 Apr 08:40
67e9bdc

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

Choose a tag to compare

@devRoemer devRoemer released this 27 Jan 09:56
9394e1e

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

Choose a tag to compare

@devRoemer devRoemer released this 27 Jan 12:24
3d3f32f

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

Choose a tag to compare

@agentschmitt agentschmitt released this 20 Jan 12:36
9c7c2bd
  • update for dotnet 6.0

3.1.5.2

Choose a tag to compare

@devRoemer devRoemer released this 27 Jan 12:23
  • add overload for ResolveDependencies with old signature for compatibility

3.1.5.1

Choose a tag to compare

@agentschmitt agentschmitt released this 01 Oct 15:28

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

Choose a tag to compare

@fkuehnSAG fkuehnSAG released this 12 Aug 13:30

Update dependencies to latest version