using Microsoft.EntityFrameworkCore;
using DD.Persistence.Database.Entity;
using DD.Persistence.Database.Model;
namespace DD.Persistence.Database;
///
/// EF контекст для любых БД поддерживаемых в EF
///
public class PersistenceDbContext : DbContext
{
public DbSet DataSaub => Set();
public DbSet Setpoint => Set();
public DbSet TimestampedSets => Set();
public DbSet ChangeLog => Set();
public DbSet TechMessage => Set();
public DbSet ParameterData => Set();
public DbSet DataSourceSystem => Set();
public PersistenceDbContext(DbContextOptions options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity()
.Property(e => e.Set)
.HasJsonConversion();
modelBuilder.Entity()
.Property(e => e.Value)
.HasJsonConversion();
}
}