mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-25 06:44:03 +08:00
17 lines
645 B
C#
17 lines
645 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.UseNpgsql("Server=localhost;Port=5432;Database=persist_message;User Id=postgres;Password=postgres;Include Error Detail=true")
|
|
.UseSnakeCaseNamingConvention();
|
|
return new PersistMessageDbContext(builder.Options);
|
|
}
|
|
}
|