private void ProcessDirectAssociation(TypeInfo ownerType, FieldInfo ownerField, TypeInfo targetType) { if (!AreMappedToSameDatabase(ownerType, targetType)) { return; } var referencingTable = GetTable(ownerType); var referencedTable = GetTable(targetType); if (referencedTable == null || referencingTable == null) { return; } var foreignKeyName = nameBuilder.BuildReferenceForeignKeyName(ownerType, ownerField, targetType); CreateReferenceForeignKey(referencingTable, referencedTable, ownerField, foreignKeyName); }