network-resurrector/NetworkResurrector.Agent.Do.../DbContexts/AgentDbContext.cs

26 lines
818 B
C#
Raw Normal View History

2020-12-23 01:18:25 +02:00
using Microsoft.EntityFrameworkCore;
using NetworkResurrector.Agent.Domain.Data.EntityTypeConfiguration;
using NetworkResurrector.Agent.Domain.Entities;
namespace NetworkResurrector.Agent.Domain.Data.DbContexts
{
public class AgentDbContext : DbContext
{
public DbSet<Machine> Machines { get; set; }
public AgentDbContext(DbContextOptions<AgentDbContext> options)
: base(options)
{
base.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;
base.ChangeTracker.AutoDetectChangesEnabled = true;
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ApplyConfiguration(new MachineConfiguration());
}
}
}