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
In Finbuckle V8 the MultiTenantIdentityDbContext had a constructor that accepted an ITenantInfo object. In V9 the constructors for MultiTenantIdentityDbContext only accept IMultiTenantContextAccessor<> objects, which broke my design time instantiation.
Do you have any examples of design time instantiation with MultiTenantIdentityDbContext for V9? If not I am sure I will get something working later today...
The text was updated successfully, but these errors were encountered:
Hi, there is now a factory Create method on MultiTenatDbContext that should let you spin up an instance easily for an IDesignTimeDbContextFactory<T> implementation. Does that work for you?
It sure did... Should have looked at the updated documentation...
public sealed class IdentityApiDbContextDesignFactory : IDesignTimeDbContextFactory<MultiTenantIdentityDbContext>
{
public MultiTenantIdentityDbContext CreateDbContext(string[] args)
{
const string connectionString = "Server=.; THE REST OF THE CONNECTION STRING;";
var optionsBuilder = new DbContextOptionsBuilder<IdentityApiDbContext>();
optionsBuilder.UseSqlServer(connectionString);
var dbContext = MultiTenantDbContext.Create<MultiTenantIdentityDbContext, AppTenantInfo>(new AppTenantInfo(), optionsBuilder.Options);
return dbContext;
}
}
I was then able to build a migration and apply it
In Finbuckle V8 the MultiTenantIdentityDbContext had a constructor that accepted an ITenantInfo object. In V9 the constructors for MultiTenantIdentityDbContext only accept IMultiTenantContextAccessor<> objects, which broke my design time instantiation.
Do you have any examples of design time instantiation with MultiTenantIdentityDbContext for V9? If not I am sure I will get something working later today...
The text was updated successfully, but these errors were encountered: