Rystem.Content.Infrastructure.Storage.File
10.0.7
dotnet add package Rystem.Content.Infrastructure.Storage.File --version 10.0.7
NuGet\Install-Package Rystem.Content.Infrastructure.Storage.File -Version 10.0.7
<PackageReference Include="Rystem.Content.Infrastructure.Storage.File" Version="10.0.7" />
<PackageVersion Include="Rystem.Content.Infrastructure.Storage.File" Version="10.0.7" />
<PackageReference Include="Rystem.Content.Infrastructure.Storage.File" />
paket add Rystem.Content.Infrastructure.Storage.File --version 10.0.7
#r "nuget: Rystem.Content.Infrastructure.Storage.File, 10.0.7"
#:package Rystem.Content.Infrastructure.Storage.File@10.0.7
#addin nuget:?package=Rystem.Content.Infrastructure.Storage.File&version=10.0.7
#tool nuget:?package=Rystem.Content.Infrastructure.Storage.File&version=10.0.7
Rystem.Content.Infrastructure.Storage.File
This provider adds Azure File Share support to the Content framework.
Repo note: the folder name is Rystem.Content.Infrastructure.Azure.Storage.File, but the current NuGet package id is Rystem.Content.Infrastructure.Storage.File.
Installation
dotnet add package Rystem.Content.Infrastructure.Storage.File
Architecture
The provider is a thin wrapper over ShareClient and ShareFileClient.
- async registration creates the share immediately
- if
Prefixis configured, registration also creates the prefix directories - uploads create missing intermediate directories on demand
- headers and metadata are mapped to Azure File Share APIs
The public registration extensions live in BuilderExtensions/ContentRepositoryBuilderExtensions.cs, while the runtime behavior is in FileStorage/FileStorageRepository.cs.
Registration API
| Method | Default lifetime | Notes |
|---|---|---|
WithFileStorageIntegrationAsync(options, name, serviceLifetime) |
Transient |
preferred path because setup is async |
WithFileStorageIntegration(options, name, serviceLifetime) |
Transient |
sync wrapper over the async implementation |
Example
This matches the unit-test startup in src/Content/Rystem.Content.Tests/Rystem.Content.UnitTest/Startup.cs.
var repositories = builder.Services.AddContentRepository();
await repositories.WithFileStorageIntegrationAsync(options =>
{
options.ShareName = "supertest";
options.Prefix = "site/";
options.ConnectionString = builder.Configuration["ConnectionString:Storage"];
}, "filestorage");
Resolve and use it:
public sealed class FileShareDocumentService
{
private readonly IContentRepository _repository;
public FileShareDocumentService(IFactory<IContentRepository> factory)
=> _repository = factory.Create("filestorage");
public ValueTask<bool> SaveAsync(string path, byte[] data)
=> _repository.UploadAsync(path, data, new ContentRepositoryOptions
{
HttpHeaders = new ContentRepositoryHttpHeaders
{
ContentType = "application/pdf"
},
Metadata = new Dictionary<string, string>
{
["department"] = "legal"
}
});
}
Settings
FileStorageConnectionSettings exposes:
| Property | Notes |
|---|---|
ConnectionString |
used when present |
EndpointUri |
used for managed identity mode |
ManagedIdentityClientId |
null means DefaultAzureCredential; otherwise ManagedIdentityCredential |
ShareName |
used in connection-string mode |
Prefix |
prepended to every logical path and pre-created as directories |
ClientOptions |
passed to ShareClient |
ClientCreateOptions |
used when creating the share |
Permissions |
passed to SetAccessPolicyAsync(...) |
Conditions |
passed to SetAccessPolicyAsync(...) |
IsPublic |
present on the settings type, but not used by the current implementation |
Managed identity note
In managed identity mode, the provider constructs the client as:
new ShareClient(settings.EndpointUri, credential, settings.ClientOptions)
So EndpointUri needs to point to the share itself. In that path, ShareName is ignored.
Provider behavior
UploadAsynccreates intermediate directories if they do not existSetPropertiesAsyncmaps HTTP headers and metadataGetPropertiesAsyncreads headers and metadataTagsare not supported and staynull
Compared with Blob Storage, this provider is more directory-oriented and less metadata-rich.
Important caveats
Listing is not recursive
ListAsync(...) enumerates a single directory scope and skips directory entries. It does not recursively walk nested folders the way the SharePoint provider does.
overwrite is effectively ignored
If the file already exists, UploadAsync(...) resizes it and uploads the new bytes regardless of the overwrite parameter.
If you need strict create-only behavior, check ExistAsync(...) first.
Path and URI semantics are inconsistent
The current implementation returns different shapes depending on the method:
DownloadAsyncreturnsPath = pathandUri = pathGetPropertiesAsyncreturnsPath = fileClient.NameListAsyncreturnsUri = fileClient.Uri.ToString()and a relative path
So treat Path and Uri as provider-defined output rather than a normalized contract.
When to use this provider
Use it when you want:
- Azure File Share as the backing store
- directory-style organization
- native file headers and metadata
- automatic directory creation during upload
It is less appropriate when you need native tag support or Blob-like path semantics.
| 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
- Azure.Identity (>= 1.19.0)
- Azure.Storage.Files.Shares (>= 12.25.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 | 76 | 3/26/2026 |
| 10.0.6 | 170,515 | 3/3/2026 |
| 10.0.5 | 92 | 2/22/2026 |
| 10.0.4 | 105 | 2/9/2026 |
| 10.0.3 | 147,857 | 1/28/2026 |
| 10.0.1 | 209,095 | 11/12/2025 |
| 9.1.3 | 238 | 9/2/2025 |
| 9.1.2 | 764,442 | 5/29/2025 |
| 9.1.1 | 97,802 | 5/2/2025 |
| 9.0.32 | 186,683 | 4/15/2025 |
| 9.0.31 | 5,791 | 4/2/2025 |
| 9.0.30 | 88,853 | 3/26/2025 |
| 9.0.29 | 9,015 | 3/18/2025 |
| 9.0.28 | 243 | 3/17/2025 |
| 9.0.27 | 258 | 3/16/2025 |
| 9.0.26 | 247 | 3/13/2025 |
| 9.0.25 | 52,122 | 3/9/2025 |
| 9.0.21 | 312 | 3/6/2025 |
| 9.0.20 | 19,599 | 3/6/2025 |
| 9.0.19 | 314 | 3/6/2025 |