Files
DaSaSo/DaSaSo.EntityFramework/DaSaSoDbContextFactory.cs
2021-09-13 15:37:23 +02:00

21 lines
666 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DaSaSo.EntityFramework
{
public class DaSaSoDbContextFactory : IDesignTimeDbContextFactory<DaSaSoDbContext>
{
public DaSaSoDbContext CreateDbContext(string[]? args = null)
{
var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
options.UseNpgsql("Host = localhost; Database = dasaso; Username = kansan; Password = kansan");
return new DaSaSoDbContext(options.Options);
}
}
}