EF CTP5 Map primary key with different column name?

It seems that the API of CTP5 doesn't offer such possibility. What we succeed to do, is to let the ModelBuilder build its MetaDataWorkspace with the wrong key.

It seems that the API of CTP5 doesn't offer such possibility. What we succeed to do, is to let the ModelBuilder build its MetaDataWorkspace with the wrong key. Then, once it is built, in the objectContext, we searched in the SSPace , the storage of Physical entities (tables and columns), then, by reflection, changed the name of the metadataproperty of the 'wrong' column name.

I know, this is far to be the right way, but it is the only one I found. We made an extension method to the ObjectBuilder, that replaces such column name, so the keys map to the correct column.

ModelBuilder.Entity() . HasKey(e => e.Id) . ToTable("Institutes", "core"); modelBuilder.Entity().

Property(e => e.Id) . HasColumnName("InstituteID").

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions