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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rystem.Content.Infrastructure.InMemory" Version="10.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rystem.Content.Infrastructure.InMemory" Version="10.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Rystem.Content.Infrastructure.InMemory" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rystem.Content.Infrastructure.InMemory --version 10.0.7
                    
#r "nuget: Rystem.Content.Infrastructure.InMemory, 10.0.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rystem.Content.Infrastructure.InMemory@10.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rystem.Content.Infrastructure.InMemory&version=10.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Rystem.Content.Infrastructure.InMemory&version=10.0.7
                    
Install as a Cake Tool

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:

  • UploadAsync stores Path, Uri, Data, and Options directly in memory
  • DeleteAsync removes the item from the dictionary
  • ExistAsync checks the dictionary key
  • SetPropertiesAsync mutates 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 = path
  • Uri = 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed