// <auto-generated>
// ReSharper disable ConvertPropertyToExpressionBody
// ReSharper disable DoNotCallOverridableMethodsInConstructor
// ReSharper disable EmptyNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable PartialMethodWithSinglePart
// ReSharper disable PartialTypeWithSinglePart
// ReSharper disable RedundantNameQualifier
// ReSharper disable RedundantOverridenMember
// ReSharper disable UseNameofExpression
// TargetFrameworkVersion = 4.72
#pragma warning disable 1591    //  Ignore "Missing XML Comment" warning


namespace AdventureWorks.Business.Entities
{

    // SalesOrderHeaderSalesReason
    [System.CodeDom.Compiler.GeneratedCode("EF.Reverse.POCO.Generator", "2.37.4.0")]
    public partial class SalesOrderHeaderSalesReasonConfiguration : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<SalesOrderHeaderSalesReason>
    {
        public SalesOrderHeaderSalesReasonConfiguration() : this("Sales")
        {
        }

        public SalesOrderHeaderSalesReasonConfiguration(string schema)
        {
            ToTable("SalesOrderHeaderSalesReason", schema);
            HasKey(x => new { x.SalesOrderId, x.SalesReasonId });

            Property(x => x.SalesOrderId).HasColumnName(@"SalesOrderID").HasColumnType("int").IsRequired().HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.None);
            Property(x => x.SalesReasonId).HasColumnName(@"SalesReasonID").HasColumnType("int").IsRequired().HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.None);
            Property(x => x.ModifiedDate).HasColumnName(@"ModifiedDate").HasColumnType("datetime").IsRequired();

            // Foreign keys
            HasRequired(a => a.SalesOrderHeader).WithMany(b => b.SalesOrderHeaderSalesReasons).HasForeignKey(c => c.SalesOrderId); // FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID
            HasRequired(a => a.SalesReason).WithMany(b => b.SalesOrderHeaderSalesReasons).HasForeignKey(c => c.SalesReasonId).WillCascadeOnDelete(false); // FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID
            InitializePartial();
        }
        partial void InitializePartial();
    }

}
// </auto-generated>
