First commit
This commit is contained in:
20
DaSaSo.EntityFramework/DaSaSoDbContextFactory.cs
Normal file
20
DaSaSo.EntityFramework/DaSaSoDbContextFactory.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user