in my project I use Entity Framework 6. I have these entities:
public class Person
{
[Key]
public int Id { get; set; }
public
You can get to the actual string "Person_Id" from the storage model, but you cannot identify that property/column as the foreign key. For that you would need Person_Id to exist in the conceptual model. I still don't quite understand why you wouldn't want it in the model, but here's how you would get it from the storage metadata:
using ( var context = new YourEntities() )
{
var objectContext = ( ( IObjectContextAdapter )context ).ObjectContext;
var storageMetadata = ( (EntityConnection)objectContext.Connection ).GetMetadataWorkspace().GetItems( DataSpace.SSpace );
var entityProps = ( from s in storageMetadata where s.BuiltInTypeKind == BuiltInTypeKind.EntityType select s as EntityType );
var personRightStorageMetadata = ( from m in entityProps where m.Name == "PersonRight" select m ).Single();
foreach ( var item in personRightStorageMetadata.Properties )
{
Console.WriteLine( item.Name );
}
}