public static string GetEntityKeyPropertyName(this Edmx edmx, string entityName) { return(edmx.GetEntityKey(entityName).PropertyRefs.Single().Name); }