Rystem.Content.Infrastructure.InMemory
10.0.7
dotnet add package Rystem.Content.Infrastructure.InMemory --version 10.0.7
NuGet\Install-Package Rystem.Content.Infrastructure.InMemory -Version 10.0.7
<PackageReference Include="Rystem.Content.Infrastructure.InMemory" Version="10.0.7" />
<PackageVersion Include="Rystem.Content.Infrastructure.InMemory" Version="10.0.7" />
<PackageReference Include="Rystem.Content.Infrastructure.InMemory" />
paket add Rystem.Content.Infrastructure.InMemory --version 10.0.7
#r "nuget: Rystem.Content.Infrastructure.InMemory, 10.0.7"
#:package Rystem.Content.Infrastructure.InMemory@10.0.7
#addin nuget:?package=Rystem.Content.Infrastructure.InMemory&version=10.0.7
#tool nuget:?package=Rystem.Content.Infrastructure.InMemory&version=10.0.7
Rystem.Content.Infrastructure.InMemory
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.
Installation
dotnet add package Rystem.Content.Infrastructure.InMemory
Registration
services
.AddContentRepository()
.WithInMemoryIntegration("inmemory");
Unlike the other built-in providers, this one registers with ServiceLifetime.Singleton.
Example
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");
}
}
Provider behavior
The runtime is straightforward:
UploadAsyncstoresPath,Uri,Data, andOptionsdirectly in memoryDeleteAsyncremoves the item from the dictionaryExistAsyncchecks the dictionary keySetPropertiesAsyncmutates the stored options object
This makes the provider very convenient for tests and also means it is not a fidelity model for remote storage services.
Important caveats
downloadContent is ignored
ListAsync(...) always yields the stored ContentRepositoryDownloadResult, so data is already present even when downloadContent == false.
informationRetrieve is mostly ignored
DownloadAsync(...) 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 path
The provider stores:
Path = pathUri = path
So Uri is only a placeholder string, not a real network URL.
State lives for the process lifetime
Because the provider is a singleton, content persists until you remove it or rebuild the host.
When to use this provider
Use it when you want:
- fast unit or integration tests
- no external infrastructure
- full round-trip of headers, metadata, and tags in memory
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 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Rystem.Content.Abstractions (>= 10.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.7 | 78 | 3/26/2026 |
| 10.0.6 | 188,116 | 3/3/2026 |
| 10.0.5 | 95 | 2/22/2026 |
| 10.0.4 | 101 | 2/9/2026 |
| 10.0.3 | 147,908 | 1/28/2026 |
| 10.0.1 | 209,077 | 11/12/2025 |
| 9.1.3 | 293 | 9/2/2025 |
| 9.1.2 | 764,479 | 5/29/2025 |
| 9.1.1 | 97,781 | 5/2/2025 |
| 9.0.32 | 186,695 | 4/15/2025 |
| 9.0.31 | 5,777 | 4/2/2025 |
| 9.0.30 | 88,837 | 3/26/2025 |
| 9.0.29 | 9,016 | 3/18/2025 |
| 9.0.28 | 248 | 3/17/2025 |
| 9.0.27 | 235 | 3/16/2025 |
| 9.0.26 | 257 | 3/13/2025 |
| 9.0.25 | 52,091 | 3/9/2025 |
| 9.0.21 | 323 | 3/6/2025 |
| 9.0.20 | 19,622 | 3/6/2025 |
| 9.0.19 | 303 | 3/6/2025 |