https://github.com/phema-team/phema.serialization
Serialization wrappers in unified manner
https://github.com/phema-team/phema.serialization
dependency-injection json messagepack serialization xml
Last synced: 2 months ago
JSON representation
Serialization wrappers in unified manner
- Host: GitHub
- URL: https://github.com/phema-team/phema.serialization
- Owner: phema-team
- License: mit
- Created: 2019-01-06T12:03:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T05:27:18.000Z (over 3 years ago)
- Last Synced: 2025-03-11T07:23:04.428Z (over 1 year ago)
- Topics: dependency-injection, json, messagepack, serialization, xml
- Language: C#
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Phema.Serialization
[](https://cloud.drone.io/phema-team/Phema.Serialization)
C# Json, xml, protobuf and messagepack wrappers for `Microsoft.Extensions.DependencyInjection`
## Packages
- [](https://www.nuget.org/packages/Phema.Serialization) `Phema.Serialization`
- [](https://www.nuget.org/packages/Phema.Serialization.Json) `Phema.Serialization.Json` - require netcoreapp3.0
- [](https://www.nuget.org/packages/Phema.Serialization.MessagePack) `Phema.Serialization.MessagePack`
- [](https://www.nuget.org/packages/Phema.Serialization.NewtonsoftJson) `Phema.Serialization.NewtonsoftJson`
- [](https://www.nuget.org/packages/Phema.Serialization.Protobuf) `Phema.Serialization.Protobuf`
- [](https://www.nuget.org/packages/Phema.Serialization.Xml) `Phema.Serialization.Xml`
## Usage
```csharp
// Json
services.AddJsonSerializer();
// Newtonsoft.Json
services.AddNewtonsoftJsonSerializer();
// MessagePack
services.AddMessagePackSerializer();
// XML
services.AddXmlSerializer();
// Protobuf
services.AddProtobufSerializer();
// Resolve
var serializer = provider.GetRequiredService();
// Serialize
var serialized = serializer.Serialize(model);
// Deserialize
var deserialized = serializer.Deserialize(serialized);
```