I want to find all the foreign keys of an entity in my entity model.
I have used the following to get a list of all the properties for an entity:
var workspace = _entities.MetadataWorkspace;
var entityType = workspace.GetItems<EntityType>(DataSpace.CSpace).FirstOrDefault(e => e.Name == tablename);
var keyNames = entityType.Members.Select(k => k.Name);
Is there any way to find only those properties which have foreign key associations? And also that property in the reference entity with which it is associated?