Soenneker.Extensions.Generic 4.0.2003

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.Generic --version 4.0.2003
                    
NuGet\Install-Package Soenneker.Extensions.Generic -Version 4.0.2003
                    
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="Soenneker.Extensions.Generic" Version="4.0.2003" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.Generic" Version="4.0.2003" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.Generic" />
                    
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 Soenneker.Extensions.Generic --version 4.0.2003
                    
#r "nuget: Soenneker.Extensions.Generic, 4.0.2003"
                    
#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 Soenneker.Extensions.Generic@4.0.2003
                    
#: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=Soenneker.Extensions.Generic&version=4.0.2003
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Generic&version=4.0.2003
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image 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 support SetLength, writing, and seeking. It is left open for the caller.
  • ToStream(CancellationToken) - Creates a new MemoryStream, 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 throws ArgumentNullException.

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 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
4.0.2018 159 9/16/2026
4.0.2017 41 9/16/2026
4.0.2016 36 9/16/2026
4.0.2015 50 9/16/2026
4.0.2014 44 9/16/2026
4.0.2013 68 9/15/2026
4.0.2012 87 9/13/2026
4.0.2011 79 9/13/2026
4.0.2010 82 9/13/2026
4.0.2009 83 9/13/2026
4.0.2008 85 9/13/2026
4.0.2007 84 9/13/2026
4.0.2006 90 9/12/2026
4.0.2005 94 9/12/2026
4.0.2004 89 9/12/2026
4.0.2003 99 9/12/2026
4.0.2002 93 9/12/2026
4.0.2001 134 9/9/2026
4.0.2000 112 9/9/2026
4.0.1999 188 9/9/2026
Loading failed

Update dependency Soenneker.Extensions.Arrays.Bytes to 4.0.67 (#2507)