Template10.Services.SerializationService 1.0.2

Handy Serialization for WinRT. Part of Template 10, a Library of Helpers for UWP.

Install-Package Template10.Services.SerializationService -Version 1.0.2
dotnet add package Template10.Services.SerializationService --version 1.0.2
<PackageReference Include="Template10.Services.SerializationService" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Template10.Services.SerializationService --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Template10.Services.SerializationService, 1.0.2"
#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 Template10.Services.SerializationService as a Cake Addin
#addin nuget:?package=Template10.Services.SerializationService&version=1.0.2

// Install Template10.Services.SerializationService as a Cake Tool
#tool nuget:?package=Template10.Services.SerializationService&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SerializationService

The SerializationService provides a simple abstracted interface to a service that implements consistent serialization and deserialization of objects:

// Serialize the passed object to a string. Returns null if the parameter is null. Returns an empty string
// if the parameter is an empty string.
string Serialize(object parameter);

// Converts the passed string back to an object. If the passed parameter is null, null is returned. If the
// string is empty, an empty string is returned.
object Deserialize(string parameter);

// Converts the passed string back to a object of type T. If deserialization fails, the default value
// for type T is returned. Note that if T is the wrong type for the passed serialized value, an
// InvalidCastException can occur. This can be avoided by using the next method.
T Deserialize<T>(string parameter);

// Attempts to deserialize the value while catching any InvalidCastException that may occur. Returns
// true if a value value was obtained, otherwise false is returned, along with the defaul value for
// type T.
bool TryDeserialize<T>(string parameter, out T result);

The NavigationService sets up an instance to the Template 10-included JSON SerializationService:

SerializationService = Service.SerializationService.SerializationService.Json;

SerializationService

The SerializationService provides a simple abstracted interface to a service that implements consistent serialization and deserialization of objects:

// Serialize the passed object to a string. Returns null if the parameter is null. Returns an empty string
// if the parameter is an empty string.
string Serialize(object parameter);

// Converts the passed string back to an object. If the passed parameter is null, null is returned. If the
// string is empty, an empty string is returned.
object Deserialize(string parameter);

// Converts the passed string back to a object of type T. If deserialization fails, the default value
// for type T is returned. Note that if T is the wrong type for the passed serialized value, an
// InvalidCastException can occur. This can be avoided by using the next method.
T Deserialize<T>(string parameter);

// Attempts to deserialize the value while catching any InvalidCastException that may occur. Returns
// true if a value value was obtained, otherwise false is returned, along with the defaul value for
// type T.
bool TryDeserialize<T>(string parameter, out T result);

The NavigationService sets up an instance to the Template 10-included JSON SerializationService:

SerializationService = Service.SerializationService.SerializationService.Json;

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Template10.Services.SerializationService:

Package Downloads
Template10.Services.DialogService
Handy Dialog Service for WinRT. Part of Template 10, a Library of Helpers for UWP.
Template10.Services.FileService
Handy File Service for WinRT. Part of Template 10, a Library of Helpers for UWP.
Template10.Services.WebService
Handy Web Service for WinRT. Part of Template 10, a Library of Helpers for UWP.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Template10.Services.SerializationService:

Repository Stars
Windows-XAML/Template10
Making Windows 10 apps great again

Version History

Version Downloads Last updated
1.0.2 1,988 10/5/2019
1.0.1 248 9/28/2019