using Microsoft.EntityFrameworkCore; using Gpulse.WCT.DataAnalyzer.Core.Domain.Local; namespace Gpulse.WCT.DataAnalyzer.Core.Infrastructure.LocalData; /// /// WCT数据采集数据库上下文 /// public class WctMinerDbContext : DbContext { public WctMinerDbContext(DbContextOptions options) : base(options) { } // 维度表 public DbSet Manufacturers => Set(); public DbSet CarModels => Set(); public DbSet TxPanels => Set(); public DbSet TxHardwares => Set(); public DbSet TxSoftwares => Set(); public DbSet RxTypes => Set(); public DbSet ForeignObjects => Set(); // 事实表 public DbSet TestScenarios => Set(); public DbSet QfodRecords => Set(); public DbSet PlossRecords => Set(); protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); // 自动应用所有 IEntityTypeConfiguration 配置 modelBuilder.ApplyConfigurationsFromAssembly(typeof(WctMinerDbContext).Assembly); } }