21 lines
603 B
C#
21 lines
603 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)
|
|
{
|
|
var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
|
|
options.UseNpgsql("server = localhost");
|
|
return new DaSaSoDbContext(options.Options);
|
|
}
|
|
}
|
|
}
|