using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;

namespace CashLineERP.Infrastructure.Persistence;

public sealed class CashLineErpDbContextFactory : IDesignTimeDbContextFactory<CashLineErpDbContext>
{
    public CashLineErpDbContext CreateDbContext(string[] args)
    {
        var builder = new DbContextOptionsBuilder<CashLineErpDbContext>();
        builder.UseSqlServer(
            "Server=localhost;Database=CashLineERP;Trusted_Connection=True;TrustServerCertificate=True");

        return new CashLineErpDbContext(builder.Options);
    }
}
