mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-18 18:02:12 +08:00
16 lines
592 B
C#
16 lines
592 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
|
|
namespace BuildingBlocks.PersistMessageProcessor.Data;
|
|
|
|
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<PersistMessageDbContext>
|
|
{
|
|
public PersistMessageDbContext CreateDbContext(string[] args)
|
|
{
|
|
var builder = new DbContextOptionsBuilder<PersistMessageDbContext>();
|
|
|
|
builder.UseSqlServer("Server=localhost;Database=PersistMessageDB;User ID=sa;Password=@Aa123456;TrustServerCertificate=True");
|
|
return new PersistMessageDbContext(builder.Options);
|
|
}
|
|
}
|