Table of Contents
Depra.Serialization
is a library that provides interfaces for abstracting serialization and deserialization of data.
- Standardization: Unified API for all serialization/deserialization formats.
- Extensibility: Flexible architecture for extending functionality to suit your needs.
- Testing: Code coverage with tests to ensure stability and reliability.
- Documentation: Detailed documentation for ease of use.
- License: Distributed under the Apache-2.0 license.
- Free: Use this library in any projects, including commercial ones.
- Security: The library does not contain code that can harm your project.
- Support: Library support will continue indefinitely.
- Independence: The library does not depend on other libraries and packages.
- Lightweight: The library does not contain unnecessary code and dependencies.
- Simplicity: The library has a simple and understandable architecture.
- Debugging Convenience: The library throws clear exceptions and error messages in debug mode (
DEBUG
).
- Support for serialization and deserialization in the following formats:
-
Binary
-
JSON
-
XML
-
YAML
-
CSV
-
- Open the NuGet Package Manager window.
- Select the Packages tab.
- Search for Depra.Serialization.
- Choose the Depra.Serialization package.
- Select the project where you want to install the package.
- Click Install.
- Download the .dll file from the Releases section or download the source code.
- Import it into your project.
The key concepts used in this library are described in the following interfaces:
IRawSerializer
- Interface for serializing and deserializing data inbyte[]
format.ITextSerializer
- Interface for serializing and deserializing data instring
format.IStreamSerializer
- Interface for serializing and deserializing data inStream
format.IMemorySerializer
- Interface for serializing and deserializing data inReadOnlyMemory<byte>
format.
- Create an instance of the serializer that supports the format you want to use. You can register it in the DI container if you are using it in your project.
IRawSerializer serializer = new BinarySerializer();
- Use the serializer to serialize and deserialize data.
var serialized = serializer.Serialize<MyDataType>(data);
var deserialized = await serializer.DeserializeAsync(serialized, typeof(MyDataType));
Depra.Json.Newtonsoft
- Adds support for serialization and deserialization in JSON format using theNewtonsoft.Json
library.Depra.Json.Microsoft
- Adds support for serialization and deserialization in JSON format using theSystem.Text.Json
library.
I welcome feature requests and bug reports in the issues section, and I also accept pull requests.
I am an independent developer, and most of the development of this project is done in my spare time. If you are interested in collaborating or hiring me for a project, please check out my portfolio and contact me!
This project is distributed under the Apache-2.0 license.
Copyright (c) 2023 Nikolay Melnikov n.melnikov@depra.org