15 lines
521 B
C#
15 lines
521 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
|
|
namespace Newsbot.Collector.Database;
|
|
|
|
public class DesignTimeContext :IDesignTimeDbContextFactory<DatabaseContext>
|
|
{
|
|
public DatabaseContext CreateDbContext(string[] args)
|
|
{
|
|
var optionsBuilder = new DbContextOptionsBuilder<DatabaseContext>();
|
|
// pass your design time connection string here
|
|
optionsBuilder.UseNpgsql("<connection_string>");
|
|
return new DatabaseContext(optionsBuilder.Options);
|
|
}
|
|
} |