![]() |
VOOZH | about |
dotnet add package Rystem.Content.Infrastructure.InMemory --version 10.0.8
NuGet\Install-Package Rystem.Content.Infrastructure.InMemory -Version 10.0.8
<PackageReference Include="Rystem.Content.Infrastructure.InMemory" Version="10.0.8" />
<PackageVersion Include="Rystem.Content.Infrastructure.InMemory" Version="10.0.8" />Directory.Packages.props
<PackageReference Include="Rystem.Content.Infrastructure.InMemory" />Project file
paket add Rystem.Content.Infrastructure.InMemory --version 10.0.8
#r "nuget: Rystem.Content.Infrastructure.InMemory, 10.0.8"
#:package Rystem.Content.Infrastructure.InMemory@10.0.8
#addin nuget:?package=Rystem.Content.Infrastructure.InMemory&version=10.0.8Install as a Cake Addin
#tool nuget:?package=Rystem.Content.Infrastructure.InMemory&version=10.0.8Install as a Cake Tool
This provider adds an in-memory content store for tests, local development, and simple non-persistent scenarios.
It is the lightest provider in the Content area: a singleton ConcurrentDictionary<string, ContentRepositoryDownloadResult> keyed by path.
dotnet add package Rystem.Content.Infrastructure.InMemory
services
.AddContentRepository()
.WithInMemoryIntegration("inmemory");
Unlike the other built-in providers, this one registers with ServiceLifetime.Singleton.
public sealed class InMemoryContentService
{
private readonly IContentRepository _repository;
public InMemoryContentService(IFactory<IContentRepository> factory)
=> _repository = factory.Create("inmemory");
public async Task RoundTripAsync()
{
await _repository.UploadAsync("folder/file.txt", System.Text.Encoding.UTF8.GetBytes("hello"), new ContentRepositoryOptions
{
HttpHeaders = new ContentRepositoryHttpHeaders
{
ContentType = "text/plain"
},
Metadata = new Dictionary<string, string>
{
["author"] = "test"
},
Tags = new Dictionary<string, string>
{
["version"] = "1"
}
});
var file = await _repository.DownloadAsync("folder/file.txt", ContentInformationType.All);
var props = await _repository.GetPropertiesAsync("folder/file.txt", ContentInformationType.All);
await _repository.DeleteAsync("folder/file.txt");
}
}
The runtime is straightforward:
UploadAsync stores Path, Uri, Data, and Options directly in memoryDeleteAsync removes the item from the dictionaryExistAsync checks the dictionary keySetPropertiesAsync mutates the stored options objectThis makes the provider very convenient for tests and also means it is not a fidelity model for remote storage services.
downloadContent is ignoredListAsync(...) always yields the stored ContentRepositoryDownloadResult, so data is already present even when downloadContent == false.
informationRetrieve is mostly ignoredDownloadAsync(...) and GetPropertiesAsync(...) return the stored object or stored options directly. They do not selectively materialize headers, metadata, or tags based on the requested flags.
Uri is just the pathThe provider stores:
Path = pathUri = pathSo Uri is only a placeholder string, not a real network URL.
Because the provider is a singleton, content persists until you remove it or rebuild the host.
Use it when you want:
Do not treat it as a perfect simulator for Blob, File Share, or SharePoint behavior.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.8 | 5,496 | 5/13/2026 |
| 10.0.7 | 127 | 3/26/2026 |
| 10.0.6 | 433,478 | 3/3/2026 |
| 10.0.5 | 124 | 2/22/2026 |
| 10.0.4 | 126 | 2/9/2026 |
| 10.0.3 | 147,933 | 1/28/2026 |
| 10.0.1 | 209,100 | 11/12/2025 |
| 9.1.3 | 319 | 9/2/2025 |
| 9.1.2 | 764,503 | 5/29/2025 |
| 9.1.1 | 97,807 | 5/2/2025 |
| 9.0.32 | 186,718 | 4/15/2025 |
| 9.0.31 | 5,801 | 4/2/2025 |
| 9.0.30 | 88,862 | 3/26/2025 |
| 9.0.29 | 9,046 | 3/18/2025 |
| 9.0.28 | 271 | 3/17/2025 |
| 9.0.27 | 259 | 3/16/2025 |
| 9.0.26 | 283 | 3/13/2025 |
| 9.0.25 | 52,118 | 3/9/2025 |
| 9.0.21 | 347 | 3/6/2025 |
| 9.0.20 | 19,650 | 3/6/2025 |