I’ve “inherited” an EF 4.0 .edmx file. Currently a given property name and column name are identical in the generated C# and SQL schema. I’ve since upgraded to EF 4.1, and changed the code generation item to generate a DbContext instead of an ObjectContext.
What I want to do is generate a SQL schema where the column names could be different. For example, say I have an Id property/column for Product; I want to generate Id for the class (via the T4 template generation) and ProductId for the column (somehow via the Generate Database from Model… context menu entry from the diagram), and then use the code-based fluent configuration capabilities to map the two via EntityTypeConfiguration<T>.HasColumnName().
Can I do this or is there a reasonable alternative? I realize I can do this all in code using 4.1, but wondering if this “transitional” approach is possible.
I abandoned this in favor of fully code-first, but I think there’s a way to do it:
.edmx.HasColumnNamecalls.this should work, but involves more effort than I’m willing to give on creating the right template.