70 lines
3.1 KiB
C#
70 lines
3.1 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using DD.Persistence.Database.Entity;
|
|
using DD.Persistence.Database.Model;
|
|
using DD.Persistence.Database.Entity.ParameterData;
|
|
|
|
namespace DD.Persistence.Database;
|
|
|
|
/// <summary>
|
|
/// EF контекст для любых БД поддерживаемых в EF
|
|
/// </summary>
|
|
public class PersistenceDbContext : DbContext
|
|
{
|
|
public DbSet<DataSaub> DataSaub => Set<DataSaub>();
|
|
|
|
public DbSet<Setpoint> Setpoint => Set<Setpoint>();
|
|
|
|
public DbSet<TimestampedSet> TimestampedSets => Set<TimestampedSet>();
|
|
|
|
public DbSet<ChangeLog> ChangeLog => Set<ChangeLog>();
|
|
|
|
public DbSet<TechMessage> TechMessage => Set<TechMessage>();
|
|
|
|
public DbSet<ParameterData> ParameterData => Set<ParameterData>();
|
|
public DbSet<ParameterData1> ParameterData1 => Set<ParameterData1>();
|
|
public DbSet<ParameterData2> ParameterData2 => Set<ParameterData2>();
|
|
public DbSet<ParameterData3> ParameterData3 => Set<ParameterData3>();
|
|
public DbSet<ParameterData4> ParameterData4 => Set<ParameterData4>();
|
|
public DbSet<ParameterData5> ParameterData5 => Set<ParameterData5>();
|
|
public DbSet<ParameterData6> ParameterData6 => Set<ParameterData6>();
|
|
public DbSet<ParameterData7> ParameterData7 => Set<ParameterData7>();
|
|
public DbSet<ParameterData8> ParameterData8 => Set<ParameterData8>();
|
|
public DbSet<ParameterData9> ParameterData9 => Set<ParameterData9>();
|
|
public DbSet<ParameterData10> ParameterData10 => Set<ParameterData10>();
|
|
public DbSet<ParameterData11> ParameterData11 => Set<ParameterData11>();
|
|
public DbSet<ParameterData12> ParameterData12 => Set<ParameterData12>();
|
|
public DbSet<ParameterData13> ParameterData13 => Set<ParameterData13>();
|
|
public DbSet<ParameterData14> ParameterData14 => Set<ParameterData14>();
|
|
public DbSet<ParameterData15> ParameterData15 => Set<ParameterData15>();
|
|
public DbSet<ParameterData16> ParameterData16 => Set<ParameterData16>();
|
|
public DbSet<ParameterData17> ParameterData17 => Set<ParameterData17>();
|
|
public DbSet<ParameterData18> ParameterData18 => Set<ParameterData18>();
|
|
public DbSet<ParameterData19> ParameterData19 => Set<ParameterData19>();
|
|
public DbSet<ParameterData20> ParameterData20 => Set<ParameterData20>();
|
|
public DbSet<ParameterData21> ParameterData21 => Set<ParameterData21>();
|
|
public DbSet<ParameterData22> ParameterData22 => Set<ParameterData22>();
|
|
public DbSet<ParameterData23> ParameterData23 => Set<ParameterData23>();
|
|
public DbSet<ParameterData24> ParameterData24 => Set<ParameterData24>();
|
|
public DbSet<ParameterData25> ParameterData25 => Set<ParameterData25>();
|
|
|
|
|
|
public DbSet<DataSourceSystem> DataSourceSystem => Set<DataSourceSystem>();
|
|
|
|
public PersistenceDbContext(DbContextOptions options)
|
|
: base(options)
|
|
{
|
|
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<TimestampedSet>()
|
|
.Property(e => e.Set)
|
|
.HasJsonConversion();
|
|
|
|
modelBuilder.Entity<ChangeLog>()
|
|
.Property(e => e.Value)
|
|
.HasJsonConversion();
|
|
}
|
|
}
|