21 lines
666 B
C#
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);
|
|
}
|
|
}
|
|
}
|