25 lines
970 B
C#
25 lines
970 B
C#
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);
|
||
|
|
}
|
||
|
|
}
|