Sicherung vor Merge
This commit is contained in:
15
scr/FSI.BT.IR.Organization.Db/Data/AppDbContext.cs
Normal file
15
scr/FSI.BT.IR.Organization.Db/Data/AppDbContext.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FSI.BT.IR.Organization.Db.Data
|
||||
{
|
||||
public class AppDbContext : DbContext, IDataContext
|
||||
{
|
||||
public AppDbContext(DbContextOptions<AppDbContext> options)
|
||||
: base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public DbSet<Models.Organization> Organizations { get; set; }
|
||||
}
|
||||
}
|
||||
16
scr/FSI.BT.IR.Organization.Db/Data/AppDbContextFactory.cs
Normal file
16
scr/FSI.BT.IR.Organization.Db/Data/AppDbContextFactory.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FSI.BT.IR.Organization.Db.Data
|
||||
{
|
||||
public class AppDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
|
||||
{
|
||||
public AppDbContext CreateDbContext(string[] args)
|
||||
{
|
||||
var optionsBuilder = new DbContextOptionsBuilder<AppDbContext>();
|
||||
optionsBuilder.UseSqlite("Data Source=FSI.BT.IR.Organization.db");
|
||||
|
||||
return new AppDbContext(optionsBuilder.Options);
|
||||
}
|
||||
}
|
||||
}
|
||||
15
scr/FSI.BT.IR.Organization.Db/Data/IDataContext.cs
Normal file
15
scr/FSI.BT.IR.Organization.Db/Data/IDataContext.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FSI.BT.IR.Organization.Db.Data
|
||||
{
|
||||
public interface IDataContext
|
||||
{
|
||||
|
||||
public DbSet<Models.Organization> Organizations { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user