mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-15 05:25:36 +08:00
17 lines
644 B
C#
17 lines
644 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(
|
|
"Data Source=.\\sqlexpress;Initial Catalog=PersistMessageDB;Persist Security Info=False;Integrated Security=SSPI;TrustServerCertificate=True");
|
|
return new PersistMessageDbContext(builder.Options);
|
|
}
|
|
}
|