From 017d03713b163f79f470da456bd1573cf4132fea Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Fri, 20 Sep 2024 09:46:21 +0200 Subject: [PATCH] =?UTF-8?q?refactor(dbcontext):=20DbContext=20aktualisiert?= =?UTF-8?q?,=20um=20IUserManagerDbContext=20zu=20implementieren=20und=20ne?= =?UTF-8?q?ue=20DbSets=20hinzuzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implementierung des `IUserManagerDbContext` Interface in `EGDbContext`. - Neue `DbSet`-Eigenschaften für `GroupOfUser`, `Group`, `ModuleOfUser`, `Module`, `User` und `UserRep` hinzugefügt. - Neue DbSets im Konstruktor injiziert. - Namespace-Importe aktualisiert, um zusätzliche Entitäten für die neuen DbSets einzubeziehen. --- .../EGDbContext.cs | 25 ++++++++++++++++++- .../EnvelopeGenerator.Web.csproj | 8 +++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/EnvelopeGenerator.Infrastructure/EGDbContext.cs b/EnvelopeGenerator.Infrastructure/EGDbContext.cs index 82051684..877dfec9 100644 --- a/EnvelopeGenerator.Infrastructure/EGDbContext.cs +++ b/EnvelopeGenerator.Infrastructure/EGDbContext.cs @@ -1,11 +1,15 @@ using DigitalData.EmailProfilerDispatcher.Abstraction.Entities; +using DigitalData.UserManager.Domain.Entities; using DigitalData.UserManager.Infrastructure; +using DigitalData.UserManager.Infrastructure.Contracts; using EnvelopeGenerator.Domain.Entities; using Microsoft.EntityFrameworkCore; +using Group = DigitalData.UserManager.Domain.Entities.Group; +using Module = DigitalData.UserManager.Domain.Entities.Module; namespace EnvelopeGenerator.Infrastructure { - public class EGDbContext : DbContext + public class EGDbContext : DbContext, IUserManagerDbContext { public DbSet UserReceivers { get; set; } @@ -31,6 +35,18 @@ namespace EnvelopeGenerator.Infrastructure public DbSet Receivers { 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; } + public EGDbContext(DbContextOptions options) : base(options) { UserReceivers = Set(); @@ -44,6 +60,13 @@ namespace EnvelopeGenerator.Infrastructure EnvelopeHistories = Set(); EnvelopeTypes = Set(); Receivers = Set(); + + GroupOfUsers = Set(); + Groups = Set(); + ModuleOfUsers = Set(); + Modules = Set(); + Users = Set(); + UserReps = Set(); } protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj index 8bed176f..53958473 100644 --- a/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj +++ b/EnvelopeGenerator.Web/EnvelopeGenerator.Web.csproj @@ -38,9 +38,9 @@ - - - + + + @@ -64,7 +64,7 @@ - +