reorganization of database layer

This commit is contained in:
2020-07-25 22:15:58 +02:00
parent 2a86c16b85
commit 110663456d
25 changed files with 471 additions and 370 deletions

View File

@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore;
namespace UserService.DatabaseLayer.DataModels
{
public class UserServiceDbContext : DbContext
{
public DbSet<User> Users { get; set; } = null!;
public DbSet<SecurityGroup> SecurityGroups { get; set; } = null!;
public DbSet<UserMember> UserMembers { get; set; } = null!;
public DbSet<OrganizationUnit> OrganizationUnits { get; set; } = null!;
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite(@"Data Source=C:\Users\holger\Desktop\UserService\UserService.db");
/// <inheritdoc />
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.CreateRelations();
modelBuilder.Seed();
}
}
}