Soenneker.Extensions.Generic
4.0.1980
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.Generic --version 4.0.1980
NuGet\Install-Package Soenneker.Extensions.Generic -Version 4.0.1980
<PackageReference Include="Soenneker.Extensions.Generic" Version="4.0.1980" />
<PackageVersion Include="Soenneker.Extensions.Generic" Version="4.0.1980" />
<PackageReference Include="Soenneker.Extensions.Generic" />
paket add Soenneker.Extensions.Generic --version 4.0.1980
#r "nuget: Soenneker.Extensions.Generic, 4.0.1980"
#:package Soenneker.Extensions.Generic@4.0.1980
#addin nuget:?package=Soenneker.Extensions.Generic&version=4.0.1980
#tool nuget:?package=Soenneker.Extensions.Generic&version=4.0.1980
Soenneker.Extensions.Generic
Generic extensions for serializing any value to a stream or a Base64-encoded JSON string.
Installation
dotnet add package Soenneker.Extensions.Generic
Quick start
using Soenneker.Extensions.Generic;
var order = new { Id = 42, Status = "Ready" };
string encoded = order.ToBase64Json();
MemoryStream jsonStream = await order.ToStream();
ToStream(Stream) is also available when you want to supply and reuse a seekable, writable destination stream yourself.
Available methods
ToStream(Stream, CancellationToken)- Clears the supplied stream, serializes the value as JSON, rewinds it to position zero, and returns that same stream. The stream must supportSetLength, writing, and seeking. It is left open for the caller.ToStream(CancellationToken)- Creates a newMemoryStream, writes the value as JSON, rewinds it, and returns it ready to read. Dispose the returned stream when finished.ToBase64Json()- Serializes the value to UTF-8 JSON bytes and returns their Base64 representation; a null value throwsArgumentNullException.
Serialization and cancellation failures propagate. A supplied stream may contain partial JSON after such a failure; the internally created MemoryStream overload disposes its stream before rethrowing. JSON naming and converter behavior come from Soenneker.Utils.Json.JsonUtil.
| 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
- Soenneker.Extensions.Arrays.Bytes (>= 4.0.66)
- Soenneker.Utils.Json (>= 4.0.2668)
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 |
|---|---|---|
| 4.0.1990 | 0 | 9/5/2026 |
| 4.0.1989 | 26 | 9/4/2026 |
| 4.0.1988 | 34 | 9/4/2026 |
| 4.0.1987 | 31 | 9/4/2026 |
| 4.0.1986 | 40 | 9/4/2026 |
| 4.0.1985 | 36 | 9/4/2026 |
| 4.0.1984 | 75 | 9/4/2026 |
| 4.0.1983 | 58 | 9/4/2026 |
| 4.0.1982 | 73 | 9/3/2026 |
| 4.0.1981 | 411 | 9/1/2026 |
| 4.0.1980 | 64 | 9/1/2026 |
| 4.0.1979 | 84 | 8/31/2026 |
| 4.0.1978 | 77 | 8/31/2026 |
| 4.0.1977 | 75 | 8/31/2026 |
| 4.0.1976 | 84 | 8/31/2026 |
| 4.0.1975 | 80 | 8/30/2026 |
| 4.0.1974 | 85 | 8/30/2026 |
| 4.0.1973 | 83 | 8/30/2026 |
| 4.0.1972 | 84 | 8/30/2026 |
| 4.0.1971 | 76 | 8/30/2026 |
Updated NuGet packages