Shuttle.Core.Serialization 10.0.7

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
.NET Standard 2.0
dotnet add package Shuttle.Core.Serialization --version 10.0.7
NuGet\Install-Package Shuttle.Core.Serialization -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="Shuttle.Core.Serialization" Version="10.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Shuttle.Core.Serialization --version 10.0.7
#r "nuget: Shuttle.Core.Serialization, 10.0.7"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Shuttle.Core.Serialization as a Cake Addin
#addin nuget:?package=Shuttle.Core.Serialization&version=10.0.7

// Install Shuttle.Core.Serialization as a Cake Tool
#tool nuget:?package=Shuttle.Core.Serialization&version=10.0.7

Shuttle.Core.Serialization

PM> Install-Package Shuttle.Core.Serialization

An implementation of the ISerializer interface is used to serialize objects into a Stream.

The DefaultSerializer makes use of the standard .NET xml serialization functionality.

Methods

Serialize

Stream Serialize(object message);

Returns the message object as a Stream.

Deserialize

object Deserialize(Type type, Stream stream);

Deserializes the Stream into an obejct of the given type.

ISerializerRootType

The ISerializerRootType interface is an optional interface that serializer implementations can use that allows the developer to specify explicit object types contained within a root type.

The DefaultSerializer implements this interface and it is recommended that you explicitly register types with the same name, but in different namespaes, that will be serialized within the same root type to avoid any conflicts later down the line.

For instance, the following two types will cause issues when used in the root Complex type as they both serialize to the same name and the .Net serializer cannot seem to distinguish the difference:

namespace Serializer.v1
{
	public class MovedEvent
	{
		public string Where { get; set; } 
	}
}

namespace Serializer.v2
{
	public class MovedEvent
	{
		public string Where { get; set; } 
	}
}

namespace Serializer
{
	public class Complex
	{
		public v1.MovedEvent { get; set; }
		public v2.MovedEvent { get; set; }
	}
}

By explicitly specifying the types the DefaultSerializer will add a namespace that will cause the types to be correctly identified.

AddSerializerType

void AddSerializerType(Type root, Type contained);

Specify the contained tpe that is used within te root type somewhere.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Shuttle.Core.Serialization:

Package Downloads
Shuttle.Esb The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Contains the core Shuttle.Esb assembly that should always be referenced when building Shuttle.Esb solutions.

Shuttle.Recall The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Event sourcing mechanism.

Shuttle.Core.Json The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Json.Net implementation of the `ISerializer` interface.

Shuttle.Core.Mediator.OpenTelemetry The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

OpenTelemetry instrumentation for Shuttle.Core.Mediator implementations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
10.0.7 878 12/1/2022
10.0.6 272 9/4/2022
10.0.5 25,415 11/27/2020
10.0.4 39,801 10/15/2018
10.0.3 22,549 10/13/2018
10.0.2 9,692 7/3/2018
10.0.1 1,590 4/8/2018
10.0.0 9,008 1/2/2018