31 lines
1.4 KiB
C#
31 lines
1.4 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using mws.backend.dotnet.domain.Audit;
|
|
using mws.backend.dotnet.domain.Documents;
|
|
using mws.backend.dotnet.domain.MasterData;
|
|
using mws.backend.dotnet.domain.Projects;
|
|
using mws.backend.dotnet.domain.Roles;
|
|
using mws.backend.dotnet.domain.Tasks;
|
|
using mws.backend.dotnet.domain.Users;
|
|
|
|
namespace mws.backend.dotnet.infrastructure.Persistence;
|
|
|
|
public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
|
|
{
|
|
public DbSet<User> Users => Set<User>();
|
|
public DbSet<UserRole> UserRoles => Set<UserRole>();
|
|
public DbSet<Project> Projects => Set<Project>();
|
|
public DbSet<ProjectMember> ProjectMembers => Set<ProjectMember>();
|
|
public DbSet<ProjectMemberPermission> ProjectMemberPermissions => Set<ProjectMemberPermission>();
|
|
public DbSet<Document> Documents => Set<Document>();
|
|
public DbSet<TaskItem> Tasks => Set<TaskItem>();
|
|
public DbSet<Role> Roles => Set<Role>();
|
|
public DbSet<RolePermission> RolePermissions => Set<RolePermission>();
|
|
public DbSet<MasterDataEntry> MasterData => Set<MasterDataEntry>();
|
|
public DbSet<ActionLog> ActionLogs => Set<ActionLog>();
|
|
public DbSet<LoginLog> LoginLogs => Set<LoginLog>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
|
|
}
|
|
} |