You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace IMultiTenantContext with ITenantContext and remove IMultiTenantContextAccessor, IMultiTenantContextSetter, and the accessor implementations. Consumers must use the ambient tenant context scope APIs. (#1212 by @AndrewTriesToCode)
ITenantResolver.ResolveAsync returns tenant information directly and exposes the primary store and cache metadata through the updated resolver contract. (#1212 by @AndrewTriesToCode)
aspnetcore
UseMultiTenant() throws a MultiTenantException at startup unless AddHttpAmbientTenantScope() was called, either directly or by an ASP.NET Core builder helper. Apps that configure only general-purpose methods such as WithStaticStrategy, WithDelegateStrategy or WithStrategy must call AddHttpAmbientTenantScope() themselves. The middleware also throws for a request that has no active ambient tenant scope. (#1238 by @AndrewTriesToCode)
A tenant set earlier in the pipeline, for example with HttpContext.SetTenantInfo in middleware before UseMultiTenant, is now kept and tenant resolution is skipped. Previously the middleware began a new scope after resolution and discarded it. (#1238 by @AndrewTriesToCode)
ASP.NET Core integrations no longer expose or consume the removed IMultiTenantContext accessor and setter abstractions; inject ITenantContext instead. (#1212 by @AndrewTriesToCode)
efcore
Querying a multi-tenant entity type through a context without a tenant set now returns no rows. It previously threw an InvalidOperationException ("An exception was thrown while attempting to evaluate a LINQ query parameter expression") wrapping a NullReferenceException. (#1239 by @AndrewTriesToCode)
IsMultiTenant on entity types was a method and is now a property. Its receiver is now non-nullable, so callers that pass a nullable entity type (for example the result of FindEntityType) get nullable warnings and must check for null first. (#1239 by @AndrewTriesToCode)
Multi-tenant DbContext constructors no longer accept IMultiTenantContextAccessor; resolve ITenantContext through the ambient scope. (#1212 by @AndrewTriesToCode)
efcoreidentity
Multi-tenant identity DbContext constructors no longer accept IMultiTenantContextAccessor; use ITenantContext from the ambient scope. (#1212 by @AndrewTriesToCode)
finbuckle
ITenantScopeProvider has two new members, EndScope() and HasScope. Custom implementations of ITenantScopeProvider must implement them. (#1238 by @AndrewTriesToCode)
ConfigurationStore creates tenants with ConfigurationBinder.Get<TTenantInfo>() from the tenant section layered over Defaults, instead of binding both sections onto an uninitialized object. A type with no parameterless constructor must have a single public constructor whose parameters match configuration keys (or use the new factory overload). Collection properties present in both Defaults and a tenant section are overlaid by index rather than appended (for example ["a","b"] in Defaults and ["c"] in a tenant gives ["c","b"]); dictionary properties are merged by key. Because constructors and property initializers now run, plain properties keep their initializer values when not configured, and collection initializers are added to rather than replaced. (#1232 by @AndrewTriesToCode)
Removes the public TypeExtensions.ImplementsOrInheritsUnboundGeneric method. (#1212 by @AndrewTriesToCode)
Remove accessor and setter registrations in favor of ITenantContext and ITenantScopeProvider. (#1212 by @AndrewTriesToCode)
IMultiTenantStore methods accept cancellation tokens; RemoveAsync removes by tenant ID and RemoveByIdentifierAsync removes by identifier. (#1212 by @AndrewTriesToCode)
Replace ITenantResolver.Stores with one primary Store and StoreCaches, and remove DistributedCacheStore and MultiTenantStoreWrapper. (#1212 by @AndrewTriesToCode)
Remove InMemoryStoreOptions and its configuring overload. Tenant identifiers are case-insensitive and initial tenants are added through TenantManager. (#1212 by @AndrewTriesToCode)
general
Only the net11.0 framework is targeted and runtime async is enabled. (#1237 by @AndrewTriesToCode)
ITenantInfo is now ITenantInfo<TId> where TId is any Equatable<TId>, e.g. int or GUID. Other types and methods taking a TTenantType generic type parameter now also take a TId generic type parameter. (#1188 by @mvanput)
default(TId) is treated as tenant not-set similar to how previously null was considered not-set. (#1188 by @mvanput)