From c7f1be7c5837f3f4c0c780e5714a82741bcd8532 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 24 Oct 2024 20:16:08 +0200 Subject: [PATCH] feat(WFDBContext): Implementiert UserManagerDbContext. --- .../Repositories/ConfigRepository.cs | 1 + WorkFlow.Infrastructure/WFDBContext.cs | 27 +++++++++++++++++-- .../WorkFlow.Infrastructure.csproj | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/WorkFlow.Infrastructure/Repositories/ConfigRepository.cs b/WorkFlow.Infrastructure/Repositories/ConfigRepository.cs index 19107ff..7353064 100644 --- a/WorkFlow.Infrastructure/Repositories/ConfigRepository.cs +++ b/WorkFlow.Infrastructure/Repositories/ConfigRepository.cs @@ -5,6 +5,7 @@ using WorkFlow.Infrastructure.Contracts; namespace WorkFlow.Infrastructure.Repositories { + //TODO: Make the db context type generic so that it can be used by other projects with different db contexts. public class ConfigRepository(WFDBContext dbContext) : CRUDRepository(dbContext, dbContext.Configs), IConfigRepository, ICRUDRepository { } diff --git a/WorkFlow.Infrastructure/WFDBContext.cs b/WorkFlow.Infrastructure/WFDBContext.cs index 071ef8a..9480be0 100644 --- a/WorkFlow.Infrastructure/WFDBContext.cs +++ b/WorkFlow.Infrastructure/WFDBContext.cs @@ -1,9 +1,12 @@ -using Microsoft.EntityFrameworkCore; +using DigitalData.UserManager.Domain.Entities; +using DigitalData.UserManager.Infrastructure; +using DigitalData.UserManager.Infrastructure.Contracts; +using Microsoft.EntityFrameworkCore; using WorkFlow.Domain.Entities; namespace WorkFlow.Infrastructure { - public class WFDBContext(DbContextOptions options) : DbContext(options) + public class WFDBContext(DbContextOptions options) : DbContext(options), IUserManagerDbContext { public DbSet Configs { get; set; } @@ -14,5 +17,25 @@ namespace WorkFlow.Infrastructure public DbSet ProfileObjStates { get; set; } public DbSet States { get; set; } + + public DbSet GroupOfUsers { get; set; } + + public DbSet Groups { get; set; } + + public DbSet ModuleOfUsers { get; set; } + + public DbSet Modules { get; set; } + + public DbSet Users { get; set; } + + public DbSet UserReps { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + //configure model builder for user manager tables + modelBuilder.ConfigureUserManager(); + + base.OnModelCreating(modelBuilder); + } } } \ No newline at end of file diff --git a/WorkFlow.Infrastructure/WorkFlow.Infrastructure.csproj b/WorkFlow.Infrastructure/WorkFlow.Infrastructure.csproj index 60521b4..88024f6 100644 --- a/WorkFlow.Infrastructure/WorkFlow.Infrastructure.csproj +++ b/WorkFlow.Infrastructure/WorkFlow.Infrastructure.csproj @@ -8,6 +8,7 @@ +