Files
mws.backend.dotnet/mws.infrastructure/Persistence/AppDbContext.cs
T

25 lines
970 B
C#
Raw Normal View History

2026-08-13 23:10:22 +07:00
using Microsoft.EntityFrameworkCore;
using Mws.Domain.Documents;
using Mws.Domain.Projects;
using Mws.Domain.Roles;
using Mws.Domain.Tasks;
using Mws.Domain.Users;
namespace Mws.Infrastructure.Persistence;
public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
public DbSet<User> Users => Set<User>();
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>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
}
}