using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace NetworkResurrector.Api.Domain.Data.EntityTypeConfiguration.Power
{
    class PowerActionConfigurationEf : IEntityTypeConfiguration<Entities.Power.PowerActionConfiguration>
    {
        public void Configure(EntityTypeBuilder<Entities.Power.PowerActionConfiguration> builder)
        {
            builder.ToTable("PowerActionConfiguration").HasKey(key => key.ConfigurationId);
            builder.Property(z => z.ConfigurationId).ValueGeneratedOnAdd();
            builder.HasOne(z => z.PowerAction).WithMany().HasForeignKey(z => z.PowerActionId);
            builder.HasOne(z => z.Performer).WithMany().HasForeignKey(z => z.PerformerId);
        }
    }
}
