51 lines
2.2 KiB
C#
51 lines
2.2 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
|
using Socialize.Api.Modules.Approvals.Data;
|
|
using Socialize.Api.Modules.Assets.Data;
|
|
using Socialize.Api.Modules.Clients.Data;
|
|
using Socialize.Api.Modules.Comments.Data;
|
|
using Socialize.Api.Modules.ContentItems.Data;
|
|
using Socialize.Api.Modules.Feedback.Data;
|
|
using Socialize.Api.Modules.Identity.Data;
|
|
using Socialize.Api.Modules.Notifications.Data;
|
|
using Socialize.Api.Modules.Projects.Data;
|
|
using Socialize.Api.Modules.Workspaces.Data;
|
|
|
|
namespace Socialize.Api.Data;
|
|
|
|
public class AppDbContext(
|
|
DbContextOptions<AppDbContext> options)
|
|
: IdentityDbContext<User, Role, Guid>(options)
|
|
{
|
|
public DbSet<Workspace> Workspaces => Set<Workspace>();
|
|
public DbSet<WorkspaceInvite> WorkspaceInvites => Set<WorkspaceInvite>();
|
|
public DbSet<Client> Clients => Set<Client>();
|
|
public DbSet<Project> Projects => Set<Project>();
|
|
public DbSet<ContentItem> ContentItems => Set<ContentItem>();
|
|
public DbSet<ContentItemRevision> ContentItemRevisions => Set<ContentItemRevision>();
|
|
public DbSet<Asset> Assets => Set<Asset>();
|
|
public DbSet<AssetRevision> AssetRevisions => Set<AssetRevision>();
|
|
public DbSet<Comment> Comments => Set<Comment>();
|
|
public DbSet<ApprovalRequest> ApprovalRequests => Set<ApprovalRequest>();
|
|
public DbSet<ApprovalDecision> ApprovalDecisions => Set<ApprovalDecision>();
|
|
public DbSet<NotificationEvent> NotificationEvents => Set<NotificationEvent>();
|
|
public DbSet<FeedbackReport> FeedbackReports => Set<FeedbackReport>();
|
|
public DbSet<FeedbackTag> FeedbackTags => Set<FeedbackTag>();
|
|
public DbSet<FeedbackScreenshot> FeedbackScreenshots => Set<FeedbackScreenshot>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder builder)
|
|
{
|
|
base.OnModelCreating(builder);
|
|
|
|
builder.ConfigureWorkspacesModule();
|
|
builder.ConfigureClientsModule();
|
|
builder.ConfigureProjectsModule();
|
|
builder.ConfigureContentItemsModule();
|
|
builder.ConfigureAssetsModule();
|
|
builder.ConfigureCommentsModule();
|
|
builder.ConfigureApprovalsModule();
|
|
builder.ConfigureNotificationsModule();
|
|
builder.ConfigureFeedbackModule();
|
|
}
|
|
}
|