Releases: z4kn4fein/stashbox-extensions-dependencyinjection
Releases · z4kn4fein/stashbox-extensions-dependencyinjection
v5.2.1
v5.2.0
ITenantDistributor
became obsolete in the mainStashbox
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
v5.1.1
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
v5.0.0
Added
IServiceProvider
extensions for supporting named resolution.
Breaking Changes
- A typo in the root namespace was fixed.
Stashbox.Extensions.Dependencyinjection
->Stashbox.Extensions.DependencyInjection
.