//---------------------------------------------------------------------------------------------
// 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 ProductModelProductDescriptionCultureConfig : IEntityTypeConfiguration<ProductModelProductDescriptionCulture>
    {
        public void Configure(EntityTypeBuilder<ProductModelProductDescriptionCulture> c)
        {
            c.ToTable("ProductModelProductDescriptionCulture", "Production")
             .HasKey(e => new { e.ProductModelId, e.ProductDescriptionId, e.CultureId });

            // configure relationships

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

            c.HasOne(e => e.ProductDescriptionObject)
             .WithMany()
             .HasForeignKey(e => e.ProductDescriptionId);

            c.HasOne(e => e.CultureObject)
             .WithMany()
             .HasForeignKey(e => e.CultureId);

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

            c.Property(e => e.ProductDescriptionId)
             .HasColumnName("ProductDescriptionID")
             .HasColumnType("int")
             .IsRequired();

            c.Property(e => e.CultureId)
             .HasColumnName("CultureID")
             .HasColumnType("nchar")
             .HasMaxLength(6)
             .IsUnicode()
             .IsFixedLength()
             .IsRequired();

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

        }
    }
}