RabbitExpress.Serializers.JsonSerializer 1.1.16

A simple JSON serializer implementation for usage in RabbitExpress.

Install-Package RabbitExpress.Serializers.JsonSerializer -Version 1.1.16
dotnet add package RabbitExpress.Serializers.JsonSerializer --version 1.1.16
<PackageReference Include="RabbitExpress.Serializers.JsonSerializer" Version="1.1.16" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RabbitExpress.Serializers.JsonSerializer --version 1.1.16
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

JSON Serializer

This library provides an implementation of a very simple serializer.

Add the reference

In your csproj add a PackageReference to this package.

<ItemGroup>
    <PackageReference Include="RabbitExpress.Serializers.JsonSerializer" Version="1.*" />
</ItemGroup>

The serializer

This is a very simple serializer to be used in the RabbitExpress.QueueClient. The implementation uses Newtonsoft.Json to serialize and deserialize the transfered messages.

public class JsonSerializer : IExpressSerializer
{
    public TObject Deserialize<TObject>(byte[] data)
    {
        var raw = Encoding.UTF8.GetString(data);
        return JsonConvert.DeserializeObject<TObject>(raw,
            new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Auto });
    }

    public byte[] Serialize<TObject>(TObject value)
    {
        var ser = JsonConvert.SerializeObject(value, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto });
        return Encoding.UTF8.GetBytes(ser);
    }
}

JSON Serializer

This library provides an implementation of a very simple serializer.

Add the reference

In your csproj add a PackageReference to this package.

<ItemGroup>
    <PackageReference Include="RabbitExpress.Serializers.JsonSerializer" Version="1.*" />
</ItemGroup>

The serializer

This is a very simple serializer to be used in the RabbitExpress.QueueClient. The implementation uses Newtonsoft.Json to serialize and deserialize the transfered messages.

public class JsonSerializer : IExpressSerializer
{
    public TObject Deserialize<TObject>(byte[] data)
    {
        var raw = Encoding.UTF8.GetString(data);
        return JsonConvert.DeserializeObject<TObject>(raw,
            new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Auto });
    }

    public byte[] Serialize<TObject>(TObject value)
    {
        var ser = JsonConvert.SerializeObject(value, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto });
        return Encoding.UTF8.GetBytes(ser);
    }
}

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.16 75 6/12/2019
1.1.15 90 6/8/2019
1.1.14 94 6/6/2019
1.1.13 97 6/3/2019
1.1.12 98 6/3/2019
1.1.11 101 6/2/2019
1.1.10 79 5/13/2019
1.1.9 86 5/11/2019