feat(WFDBContext): Implementiert UserManagerDbContext.

This commit is contained in:
Developer 02 2024-10-24 20:16:08 +02:00
parent 70d7ed7415
commit c7f1be7c58
3 changed files with 27 additions and 2 deletions

View File

@ -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<Config, int, WFDBContext>(dbContext, dbContext.Configs), IConfigRepository, ICRUDRepository<Config, int>
{
}

View File

@ -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<Config> Configs { get; set; }
@ -14,5 +17,25 @@ namespace WorkFlow.Infrastructure
public DbSet<ProfileObjState> ProfileObjStates { get; set; }
public DbSet<State> States { get; set; }
public DbSet<GroupOfUser> GroupOfUsers { get; set; }
public DbSet<Group> Groups { get; set; }
public DbSet<ModuleOfUser> ModuleOfUsers { get; set; }
public DbSet<Module> Modules { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<UserRep> UserReps { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
//configure model builder for user manager tables
modelBuilder.ConfigureUserManager();
base.OnModelCreating(modelBuilder);
}
}
}

View File

@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.0.0" />
<PackageReference Include="UserManager.Infrastructure" Version="2.0.0" />
</ItemGroup>
<ItemGroup>