Im using the ADO.NET entity data model wizard to create a bunch of POCO's from my database. I choose the code first from database option, then select the tables i require. The 'include foreign key columns in the model' option is greyed out but checked. When I check my dbcontext model thats generated, i have all the Dbsets I selected, but only 2 tables have the modelbuilder properties set in the OnModelCreating method
modelBuilder.Entity<Contact>()
.HasMany(e => e.ContactOrgAuthoriseds)
.WithRequired(e => e.Contact)
.HasForeignKey(e => e.ContactID)
.WillCascadeOnDelete(false);
modelBuilder.Entity<Contract>()
.HasMany(e => e.ContractSites)
.WithRequired(e => e.Contract)
.HasForeignKey(e => e.ContractID)
.WillCascadeOnDelete(false);There are many, many more tables with foreign keys but the process hasnt picked them up, anyone know why this should be ?