Skip to content

Commit

Permalink
Fixing ObjectDisposedException when using database shell settings
Browse files Browse the repository at this point in the history
  • Loading branch information
vengi83644 authored Nov 25, 2024
1 parent 95f1849 commit d6f7bfc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ public async Task AddSourcesAsync(string tenant, IConfigurationBuilder builder)
if (configuration is not null)
{
var configurationString = configuration.ToJsonString(JOptions.Default);
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(configurationString));

builder.AddTenantJsonStream(stream);
builder.AddTenantJsonStream(new MemoryStream(Encoding.UTF8.GetBytes(configurationString)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ public async Task AddSourcesAsync(IConfigurationBuilder builder)
if (document.ShellsSettings is not null)
{
var shellsSettingsString = document.ShellsSettings.ToJsonString(JOptions.Default);
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(shellsSettingsString));

builder.AddTenantJsonStream(stream);
builder.AddTenantJsonStream(new MemoryStream(Encoding.UTF8.GetBytes(shellsSettingsString)));
}
}

Expand All @@ -55,9 +53,7 @@ public async Task AddSourcesAsync(string tenant, IConfigurationBuilder builder)
{
var shellSettings = new JsonObject { [tenant] = document.ShellsSettings[tenant] };
var shellSettingsString = shellSettings.ToJsonString(JOptions.Default);
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(shellSettingsString));

builder.AddTenantJsonStream(stream);
builder.AddTenantJsonStream(new MemoryStream(Encoding.UTF8.GetBytes(shellSettingsString)));
}
}

Expand Down

0 comments on commit d6f7bfc

Please sign in to comment.