//---------------------------------------------------------------------------------------------
// This file was AUTO-GENERATED by "EF Domain Objects" Xomega.Net generator.
//
// Manual CHANGES to this file WILL BE LOST when the code is regenerated.
//---------------------------------------------------------------------------------------------

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

namespace AdventureWorks.Services.Entities
{
    public class ProductModelIllustrationConfig : IEntityTypeConfiguration<ProductModelIllustration>
    {
        public void Configure(EntityTypeBuilder<ProductModelIllustration> c)
        {
            c.ToTable("ProductModelIllustration", "Production")
             .HasKey(e => new { e.ProductModelId, e.IllustrationId });

            // configure relationships

            c.HasOne(e => e.ProductModelObject)
             .WithMany()
             .HasForeignKey(e => e.ProductModelId);

            c.HasOne(e => e.IllustrationObject)
             .WithMany()
             .HasForeignKey(e => e.IllustrationId);

            // configure properties
          
            c.Property(e => e.ProductModelId)
             .HasColumnName("ProductModelID")
             .HasColumnType("int")
             .IsRequired();

            c.Property(e => e.IllustrationId)
             .HasColumnName("IllustrationID")
             .HasColumnType("int")
             .IsRequired();

            c.Property(e => e.ModifiedDate)
             .HasColumnName("ModifiedDate")
             .HasColumnType("datetime")
             .IsRequired();

        }
    }
}