Skip to content

Releases: z4kn4fein/stashbox

Stashbox v5.14.1

08 Apr 11:11
Compare
Choose a tag to compare

Fixed

  • #163: Last-write win problem when hash collision happens.

Stashbox v5.14.0

15 Dec 01:58
Compare
Choose a tag to compare

Added

  • WithRequiredMemberInjection() registration and container configuration option to control the auto injection of required members.

Stashbox v5.13.0

18 Nov 23:54
7556ae3
Compare
Choose a tag to compare

Added

  • .NET 8.0 target.
  • #134 Concept of Auto lifetime:
    • It aligns to the lifetime of the resolved service's dependencies. When the underlying service has a dependency with a higher lifespan, this lifetime will inherit that lifespan up to a given boundary.
  • Auto injection of required members.
  • MS.DI compatibility features for supporting keyed services:
    • DependencyName attribute. When a parameter is marked with this attribute, the container will pass the given dependency's name to it.
    • WithUniversalName() container configuration method. It sets the universal name which is a special name that allows named resolution work for any given name.
    • WithAdditionalDependencyNameAttribute() container configuration method. It adds an attribute type that is considered a dependency name indicator just like the DependencyName attribute.
    • WithAdditionalDependencyAttribute() container configuration method. It adds an attribute type that is considered a dependency indicator just like the Dependency attribute.

Stashbox v5.12.2

05 Sep 16:00
Compare
Choose a tag to compare

Fixed

  • There was an issue where using decorators with instance registrations resulted in resolution failure.

Stashbox v5.12.1

05 Sep 09:39
Compare
Choose a tag to compare

Fixed

  • #144: There was a case where closed generic decorators were not taken into account during service resolution.
  • #143: Child scopes attached to their parents were not removed from disposal tracking when they were disposed individually.
  • #141: There was a case where wrong decorators were selected during an IEnumerable<T> resolution call.

Stashbox v5.11.1

16 Aug 20:56
Compare
Choose a tag to compare

Fixed

  • #142: Upon disposing child containers, their parents still held a strong reference to them.

Stashbox v5.11.0

21 Jun 20:57
Compare
Choose a tag to compare

Changed

  • Moved several functions of IDependencyResolver to extension methods.

Stashbox v5.10.2

13 Jun 18:59
Compare
Choose a tag to compare

Added

  • Access to the actual TypeInformation as a factory delegate input parameter. The TypeInformation holds every reflected context information about the currently resolving type. This can be useful when the resolution is, e.g., in an open generic context, and we want to know which closed generic variant is requested.
    container.Register(typeof(IService<>), options => options.WithFactory<TypeInformation>(typeInfo => 
       {
          /* typeInfo.Type holds the currently resolving closed generic type */
       }));

Stashbox v5.10.1

09 Jun 11:30
Compare
Choose a tag to compare

Added

  • ParentDependency flag for ResolutionBehavior. It indicates that parent containers (including indirect all ancestors) can only provide dependencies for services that are already selected for resolution.

Fixed

  • During factory resolution, the type map check failed for registrations like: .Register<IService>(c => c.WithFactory(/* ... */).AsServiceAlso<IAnother>()). Now, the container gets the implementation type from the generic context where it's possible.

Stashbox v5.10.0

05 Jun 00:45
Compare
Choose a tag to compare

Changed

  • Each Resolve() method now accepts a ResolutionBehavior flag parameter. It determines which level of the container hierarchy can take part in the service resolution. Possible values:
    • Parent: Indicates that parent containers (including indirect all ancestors) can participate in the resolution request's service selection.
    • Current: Indicates that the current container (which initiated the resolution request) can participate in the service selection.
    • Default: The default behavior, it's used when the parameter is not specified. Its value is Parent | Current, so the parents and the current (which initiated the resolution request) container can participate in the resolution request's service selection.
  • CreateChildContainer() now accepts an attachToParent boolean parameter, which indicates whether the parent container's disposal should also dispose the child. It defaults to true.
  • ITenantDistributor and TenantDistributor types became obsolete. Their functionality is available on IStashboxContainer.
    • ITenantDistributor.ConfigureTenant() -> IStashboxContainer.CreateChildContainer()
    • ITenantDistributor.GetTenant() -> IStashboxContainer.GetChildContainer()
  • Calling Validate() on a container will execute validation on each of its child container if it has any.

Fixed

  • IEnumerable<T> and ResolveAll() requests were not taking services in parent containers into account. Now, it respects the given ResolutionBehavior and as its default value is Parent | Current, IEnumerable<T> requests will return services from parent containers by default.
  • Decorator selection during a resolution request was not take parent containers into consideration. It now respects the given ResolutionBehavior parameter.