Skip to content

Compatibility with Xamarin.Android #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Plato.Serializers/ObjectMessagePackSerializer.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Plato.Core
// Plato.Core
// Copyright (c) 2020 ReflectSoftware Inc.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using MsgPack.Serialization;
using System;
using System.IO;
using MessagePack;

namespace Plato.Serializers
{
Expand All @@ -21,7 +21,7 @@ public class ObjectMessagePackSerializer : ObjectSerializerBase
/// <param name="obj">The object.</param>
public override void Serialize(Stream stream, object obj)
{
MessagePackSerializer.Get(obj.GetType()).Pack(stream, obj);
MessagePackSerializer.Serialize(obj.GetType(),stream, obj);
}

/// <summary>
Expand All @@ -34,7 +34,7 @@ public override T Deserialize<T>(byte[] bObj)
{
using (var ms = new MemoryStream(bObj))
{
return MessagePackSerializer.Get<T>().Unpack(ms);
return MessagePackSerializer.Deserialize<T>(ms);
}
}

Expand All @@ -48,7 +48,7 @@ public override object Deserialize(Type type, byte[] bObj)
{
using (var ms = new MemoryStream(bObj))
{
return MessagePackSerializer.Get(type).Unpack(ms);
return MessagePackSerializer.Deserialize(type,ms);
}
}

Expand All @@ -60,7 +60,7 @@ public override object Deserialize(Type type, byte[] bObj)
/// <returns></returns>
public override T Deserialize<T>(Stream stream)
{
return MessagePackSerializer.Get<T>().Unpack(stream);
return MessagePackSerializer.Deserialize<T>(stream);
}

/// <summary>
Expand All @@ -71,7 +71,7 @@ public override T Deserialize<T>(Stream stream)
/// <returns></returns>
public override object Deserialize(Type type, Stream stream)
{
return MessagePackSerializer.Get(type).Unpack(stream);
return MessagePackSerializer.Deserialize(type, stream);
}
}
}
4 changes: 2 additions & 2 deletions src/Plato.Serializers/Plato.Serializers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<Description>Plato.Serializers .NET Core library</Description>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ServiceStack.MsgPack.Core" Version="5.9.0" />
<ItemGroup>
<PackageReference Include="MessagePack" Version="2.1.152" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/Plato/Plato.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="5.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Autofac" Version="5.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.5" />
<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.0.0" />
Expand Down