//---------------------------------------------------------------------------------------------
// 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 SpecialOfferProductConfig : IEntityTypeConfiguration<SpecialOfferProduct>
    {
        public void Configure(EntityTypeBuilder<SpecialOfferProduct> c)
        {
            c.ToTable("SpecialOfferProduct", "Sales")
             .HasKey(e => new { e.SpecialOfferId, e.ProductId });

            // configure relationships

            c.HasOne(e => e.SpecialOfferObject)
             .WithMany()
             .HasForeignKey(e => e.SpecialOfferId);

            c.HasOne(e => e.ProductObject)
             .WithMany()
             .HasForeignKey(e => e.ProductId);

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

            c.Property(e => e.ProductId)
             .HasColumnName("ProductID")
             .HasColumnType("int")
             .IsRequired();

            c.Property(e => e.Rowguid)
             .HasColumnName("rowguid")
             .HasColumnType("uniqueidentifier")
             .IsRequired();

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

        }
    }
}