using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using NetworkResurrector.Api.Domain.Entities;

namespace NetworkResurrector.Api.Domain.Data.EntityTypeConfiguration
{
    class MachineConfiguration : IEntityTypeConfiguration<Machine>
    {
        public void Configure(EntityTypeBuilder<Machine> builder)
        {
            builder.ToTable("Machine").HasKey(key => key.MachineId);
            builder.Property(z => z.MachineId).ValueGeneratedOnAdd();
            builder.HasOne(z => z.Agent).WithOne();
        }
    }
}
