26 lines
818 B
C#
26 lines
818 B
C#
|
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());
|
|||
|
}
|
|||
|
}
|
|||
|
}
|