25 lines
879 B
C#
25 lines
879 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using TakeoutSaaS.Infrastructure.Common.Persistence.DesignTime;
|
|
using TakeoutSaaS.Shared.Abstractions.Security;
|
|
using TakeoutSaaS.Shared.Abstractions.Tenancy;
|
|
|
|
namespace TakeoutSaaS.Infrastructure.Identity.Persistence;
|
|
|
|
/// <summary>
|
|
/// 设计时 IdentityDbContext 工厂,供 EF Core CLI 生成迁移使用。
|
|
/// </summary>
|
|
internal sealed class IdentityDesignTimeDbContextFactory
|
|
: DesignTimeDbContextFactoryBase<IdentityDbContext>
|
|
{
|
|
public IdentityDesignTimeDbContextFactory()
|
|
: base("TAKEOUTSAAS_IDENTITY_CONNECTION", "takeout_saas_identity")
|
|
{
|
|
}
|
|
|
|
protected override IdentityDbContext CreateContext(
|
|
DbContextOptions<IdentityDbContext> options,
|
|
ITenantProvider tenantProvider,
|
|
ICurrentUserAccessor currentUserAccessor)
|
|
=> new(options, tenantProvider, currentUserAccessor);
|
|
}
|