Skip to content

Releases: z4kn4fein/stashbox-extensions-dependencyinjection

v5.2.1

09 Jun 12:21
Compare
Choose a tag to compare
  • Bumped Stashbox version to v5.10.1.
  • Fixed #10.

v5.2.0

05 Jun 01:05
Compare
Choose a tag to compare
  • ITenantDistributor became obsolete in the main Stashbox package. The multi-tenant configuration API now looks like the following:
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseStashboxMultitenant<HttpHeaderTenantIdExtractor>(
    options => // Multi-tenant configuration options.
{
    // The default service registration, it registers into the root container.
    // It also could be registered into the default 
    // service collection with the ConfigureServices() API.
    options.RootContainer.Register<IDependency, DefaultDependency>();

    // Configure tenants.
    options.ConfigureTenant("TenantA", tenant => 
        // Register tenant specific service override
        tenant.Register<IDependency, TenantASpecificDependency>());

    options.ConfigureTenant("TenantB", tenant => 
        // Register tenant specific service override
        tenant.Register<IDependency, TenantBSpecificDependency>());
});

// The container parameter is the tenant distributor itself.
// Calling its Validate() method will verify the root container and each tenant.
builder.Host.ConfigureContainer<IStashboxContainer>((context, container) =>
{
    // Validate the root container and all tenants.
    if (context.HostingEnvironment.IsDevelopment())
        container.Validate();
});

v5.1.2

02 Jun 08:33
Compare
Choose a tag to compare

Fixed

  • The generic version of GetService<T>(object name) threw a ResolutionFailedException when a resolution failed instead of returning null.

v5.1.1

01 Jun 11:43
Compare
Choose a tag to compare

Fixed

  • The per-request expression cache stored the underlying expressions with type conversion to the requested service type. This caused type mismatch exceptions when a service was registered to multiple base types. Now, the cache stores the raw instantiation expression and the conversion happens one layer above when needed.

v5.1.0

31 May 10:23
Compare
Choose a tag to compare

Fixed

  • Resolving IServiceProvider always returned the actual resolution scope, which prevented the usage of custom registered implementations. Now, the container returns the actual resolution scope only when no other IServiceProvider implementation is registered.
    Related issue: #9

v5.0.0

28 May 16:26
Compare
Choose a tag to compare

Added

Breaking Changes

  • A typo in the root namespace was fixed. Stashbox.Extensions.Dependencyinjection -> Stashbox.Extensions.DependencyInjection.