using foodmarket.Application.Common.Tenancy; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; namespace foodmarket.Infrastructure.Persistence; internal class DesignTimeAppDbContextFactory : IDesignTimeDbContextFactory { public AppDbContext CreateDbContext(string[] args) { var opts = new DbContextOptionsBuilder() .UseNpgsql("Host=localhost;Port=5432;Database=food_market;Username=nns;Password=") .UseOpenIddict() .Options; return new AppDbContext(opts, new DesignTimeTenantContext()); } private sealed class DesignTimeTenantContext : ITenantContext { public Guid? OrganizationId => null; public bool IsAuthenticated => false; public bool IsSuperAdmin => true; } }