An open API service indexing awesome lists of open source software.

https://github.com/mustaddon/typeserialization

.NET Serialization an object type to/from a string/json
https://github.com/mustaddon/typeserialization

dotnet string-to-type string2type type-from-json type-from-string type-serializer type-to-json type2json type2string uri-safe url-safe

Last synced: 5 months ago
JSON representation

.NET Serialization an object type to/from a string/json

Awesome Lists containing this project

README

          

# TypeSerialization [![NuGet version](https://badge.fury.io/nu/TypeSerialization.svg)](http://badge.fury.io/nu/TypeSerialization)
Serialization an object type to/from a string

## Features
* Generics support
* URI safe format

## Example 1: Serialization
```C#
var str = TypeSerializer.Serialize(typeof(Dictionary));
Console.WriteLine(str);

// Console output:
// Dictionary(Int32-String)
```

## Example 2: Deserialization
```C#
var deserializer = new TypeDeserializer(/* add your possible types for resolving */);
var type = deserializer.Deserialize("Dictionary(Int32-String)");
Console.WriteLine(type);

// Console output:
// System.Collections.Generic.Dictionary`2[System.Int32,System.String]
```

[Program.cs](https://github.com/mustaddon/TypeSerialization/tree/master/Examples/Program.cs)