using Microsoft.EntityFrameworkCore; using Persistence.Database.Entity; using Persistence.Database.Model; namespace 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 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(); } }