2026-07-02 18:13:56 +08:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
2026-08-13 15:00:39 +08:00
|
|
|
using Gpulse.WCT.DataAnalyzer.Core.Domain.Local;
|
2026-07-02 18:13:56 +08:00
|
|
|
|
2026-08-13 15:00:39 +08:00
|
|
|
namespace Gpulse.WCT.DataAnalyzer.Core.Infrastructure.LocalData;
|
2026-07-02 18:13:56 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// WCT数据采集数据库上下文
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class WctMinerDbContext : DbContext
|
|
|
|
|
{
|
|
|
|
|
public WctMinerDbContext(DbContextOptions<WctMinerDbContext> options)
|
|
|
|
|
: base(options) { }
|
|
|
|
|
|
|
|
|
|
// 维度表
|
|
|
|
|
public DbSet<TxPanel> TxPanels => Set<TxPanel>();
|
|
|
|
|
public DbSet<TxHardware> TxHardwares => Set<TxHardware>();
|
|
|
|
|
public DbSet<TxSoftware> TxSoftwares => Set<TxSoftware>();
|
|
|
|
|
public DbSet<RxType> RxTypes => Set<RxType>();
|
|
|
|
|
|
|
|
|
|
// 事实表
|
|
|
|
|
public DbSet<TestScenario> TestScenarios => Set<TestScenario>();
|
|
|
|
|
public DbSet<QfodRecord> QfodRecords => Set<QfodRecord>();
|
|
|
|
|
public DbSet<PlossRecord> PlossRecords => Set<PlossRecord>();
|
|
|
|
|
|
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
|
|
|
|
|
|
// 自动应用所有 IEntityTypeConfiguration<T> 配置
|
|
|
|
|
modelBuilder.ApplyConfigurationsFromAssembly(typeof(WctMinerDbContext).Assembly);
|
|
|
|
|
}
|
|
|
|
|
}
|