Skip to content

Commit a4259ce

Browse files
committed
refactor(Isolation): Adjust message implementation
1 parent c2a5ea7 commit a4259ce

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Isolation/Masa.Contrib.Isolation.UoW.EF/DefaultConnectionStringProvider.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ private string SetConnectionString(string? connectionString = null)
7777

7878
private string GetMessage()
7979
{
80-
StringBuilder stringBuilder = new StringBuilder();
80+
List<string> messages = new List<string>();
8181
if (_environmentContext != null)
82-
stringBuilder.Append($"Environment: [{_environmentContext.CurrentEnvironment}], ");
82+
messages.Add($"Environment: [{_environmentContext.CurrentEnvironment}]");
8383
if (_tenantContext != null)
84-
stringBuilder.Append($"Tenant: [{_tenantContext.CurrentTenant?.Id ?? ""}], ");
85-
var message = stringBuilder.ToString();
86-
return message.Substring(0, message.Length - 2);
84+
messages.Add($"Tenant: [{_tenantContext.CurrentTenant?.Id ?? ""}]");
85+
return string.Join(", ", messages);
8786
}
8887
}

0 commit comments

Comments
 (0)