I need to have an entity that has two separate candidate keys, where one of them is the primary key, which is a surrogate identification key, and the other is an alternative key representing a real unique attribute. I need them both to be separate in my essence. Please note that I do not mean composite or multi-column keys. Anyway, I need to have this on one of my entities in the ADO.NET data model. Can this be done? If yes, please help me.
The reason for the second key is that I need another object to communicate with the first entity on this key.
Update: I found a very similar situation for me in the following question: http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/a248632a-d305-4c15-8e57-6742457cca94 It seems that EF v1 does not support this function. Does anyone know if V4 (literally the second version) has this feature or not? I found the following, but there seemed to be no clue that this feature was added to the current version: http://blogs.msdn.com/b/adonet/archive/2009/05/11/update-on- the-entity-framework-in-net-4-and-visual-studio-2010.aspx
Entity framework . . , EF , . , .
EF, .NET 4.5.
Code First API, DbContexts . EntityTypeConfiguration , . , , : http://mmilleruva.blogspot.com/2013/10/working-with-legacy-database-schemas.html