using CAPI.Custom.Entities; using System.Data.Entity.ModelConfiguration; namespace CAPI.Custom.Data.Mappings { public class SurfaceLookupMapping : EntityTypeConfiguration { public SurfaceLookupMapping() { ToTable("pal_SurfaceLookup"); HasKey(p => p.recId); Property(p => p.categoryId).HasColumnName("categoryId"); Property(p => p.customCode).HasColumnName("customCode"); Property(p => p.display).HasColumnName("display"); Property(p => p.isActive).HasColumnName("isActive"); Property(p => p.recId).HasColumnName("recId"); Property(p => p.sequence).HasColumnName("sequence"); Property(p => p.wantsReason).HasColumnName("wantsReason"); HasRequired(p => p.LookupCategory) .WithMany(q => q.SufaceLookups) .HasForeignKey(p => p.categoryId); } } }