Fix: Risolto double-mapping negli External ID Relationships per Salesforce
- Implementata funzionalità completa External ID Relationships nell'interfaccia di mapping
- Corretto bug double-mapping: i campi sorgente usati per External ID non vengono più inclusi nei mapping normali
- Risolto errore MALFORMED_ID causato dall'invio duplicato di campi come proprietà dirette e nested objects
- Implementata logica corretta per relationship names: oggetti standard usano il nome diretto, custom objects usano suffisso __r
- Aggiunta UI a 3 colonne (Object, External ID Field, Source Field) per configurazione External ID Relationships
- Migrazione database per supporto External ID Relationships nei profili
- Aggiornato ProfileSaver.razor.cs per salvare/caricare External ID Relationships
- Aggiornato ScheduledProfileExecutionService.cs per gestire External ID nelle esecuzioni schedulate
- Formato JSON output corretto: { 'Account': { 'CardCode__c': 'V50000' } }
Documentazione: EXTERNAL_ID_RELATIONSHIPS_IMPLEMENTATION.md
This commit is contained in:
@@ -174,13 +174,51 @@ public static class ConnectionStringBuilder
|
||||
};
|
||||
} private static string BuildSqlServerConnectionString(DatabaseCredential credential)
|
||||
{
|
||||
var builder = new List<string>
|
||||
var builder = new List<string>();
|
||||
|
||||
// Gestione speciale per SQL Server locale e named instances
|
||||
// Se l'host contiene '\' (instance name) o '(localdb)', non aggiungere la porta
|
||||
bool hasInstanceName = credential.Host.Contains('\\') ||
|
||||
credential.Host.StartsWith("(localdb)", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (hasInstanceName)
|
||||
{
|
||||
$"Server={credential.Host},{credential.Port}",
|
||||
$"User Id={credential.Username}",
|
||||
$"Password={credential.Password}",
|
||||
$"Connection Timeout={credential.CommandTimeout}"
|
||||
};
|
||||
// Per named instances e LocalDB, non includere la porta
|
||||
builder.Add($"Server={credential.Host}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Per connessioni TCP/IP standard, include host e porta
|
||||
// Ma solo se la porta non è la default (1433) per localhost
|
||||
if ((credential.Host.Equals("localhost", StringComparison.OrdinalIgnoreCase) ||
|
||||
credential.Host == "." ||
|
||||
credential.Host == "127.0.0.1") && credential.Port == 1433)
|
||||
{
|
||||
// Per localhost con porta default, ometti la porta per usare Named Pipes
|
||||
builder.Add($"Server={credential.Host}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Per altri casi, usa host,porta
|
||||
builder.Add($"Server={credential.Host},{credential.Port}");
|
||||
}
|
||||
}
|
||||
|
||||
// Se username è vuoto o è "Integrated", usa Windows Authentication
|
||||
if (string.IsNullOrWhiteSpace(credential.Username) ||
|
||||
credential.Username.Equals("Integrated", StringComparison.OrdinalIgnoreCase) ||
|
||||
credential.Username.Equals("Windows", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
builder.Add("Integrated Security=True");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Usa SQL Server Authentication
|
||||
builder.Add($"User Id={credential.Username}");
|
||||
builder.Add($"Password={credential.Password}");
|
||||
}
|
||||
|
||||
builder.Add($"Connection Timeout={credential.CommandTimeout}");
|
||||
|
||||
// Aggiungi Database solo se specificato
|
||||
if (!string.IsNullOrEmpty(credential.DatabaseName))
|
||||
|
||||
Reference in New Issue
Block a user