public static PropertyInfo GetForeignKeyProperty(this DbContext context, PropertyInfo property) { AssociationType foreignKey = ForeignKeyForNavigationProperty(context, property.DeclaringType, property); PropertyInfo foreignKeyProperty = foreignKey.GetForeignKeyProperty(property.DeclaringType); return(foreignKeyProperty); }