xiangning 6c110b579a refactor(dependencies): 移除未使用的域实体引用
- 从文件模块的多部分上传处理器中移除未使用的实体引用
- 从即时通讯模块的群组成员处理器中移除未使用的实体引用
- 从RAG模块的AI模型配置中移除未使用的实体引用
- 从监控模块的告警规则配置中移除未使用的实体引用
- 从平台模块的角色权限处理器中移除未使用的实体引用
- 从脚本模块的执行日志实体引用中进行清理
- 从多个基础设施配置类中移除未使用的依赖项
- 优化测试文件中的导入声明,移除不必要的引用
2026-07-19 14:09:47 +08:00

30 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using File.Domain.Entities.FileMeta;
using File.Domain.Entities.FileSetting;
using File.Domain.Entities.Folder;
using File.Domain.Entities.MultipartUploadSession;
using File.Domain.Entities.ShareLink;
using Microsoft.EntityFrameworkCore;
namespace File.Infrastructure.Persistence;
/// <summary>
/// file-system 统一 DbContext。聚合 FolderEntity/FileMetaEntity/ShareLinkEntity/MultipartUploadSessionEntity 聚合根。
/// 注意:实体均不实现 ISoftDelete,故无全局软删除查询过滤器,Remove() 走真实物理删除(忠实 Go 版语义)。
/// </summary>
public class FileDbContext : DbContext
{
public FileDbContext(DbContextOptions<FileDbContext> options) : base(options) { }
public DbSet<FolderEntity> Folders => Set<FolderEntity>();
public DbSet<FileMetaEntity> Files => Set<FileMetaEntity>();
public DbSet<ShareLinkEntity> ShareLinks => Set<ShareLinkEntity>();
public DbSet<MultipartUploadSessionEntity> UploadSessions => Set<MultipartUploadSessionEntity>();
public DbSet<FileSettingEntity> Settings => Set<FileSettingEntity>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// 自动发现并应用当前程序集中所有 IEntityTypeConfiguration<T>
modelBuilder.ApplyConfigurationsFromAssembly(typeof(FileDbContext).Assembly);
}
}