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
- Host: GitHub
- URL: https://github.com/mustaddon/typeserialization
- Owner: mustaddon
- License: mit
- Created: 2022-10-27T15:41:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-25T11:46:31.000Z (about 1 year ago)
- Last Synced: 2025-10-28T14:19:16.741Z (8 months ago)
- Topics: dotnet, string-to-type, string2type, type-from-json, type-from-string, type-serializer, type-to-json, type2json, type2string, uri-safe, url-safe
- Language: C#
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TypeSerialization [](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)