Skip to content
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

Unpack c# msgpack #32

Closed
Almis90 opened this issue Apr 10, 2016 · 2 comments
Closed

Unpack c# msgpack #32

Almis90 opened this issue Apr 10, 2016 · 2 comments

Comments

@Almis90
Copy link

Almis90 commented Apr 10, 2016

I using https://github.com/msgpack/msgpack-cli and here are my classes

[DataContract]
public class Client
{
    [DataMember(Order = 0)]
    public int Id { get; set; }
    [DataMember(Order = 1)]
    public Information Information { get; set; }
}

[DataContract]
public class Information
{
    [DataMember(Order = 0)]
    public string Name { get; set; }
}

When I unpack it from server side I get

[1, ['John']]

The data is correct but it's not an object. I understand the reason but is there any way to convert it to my model?

@kawanet
Copy link
Owner

kawanet commented Apr 10, 2016

msgpack itself doesn't have a kind of object mapping feature by nature.

I have no idea whether the C# binding might have it however.

Why don't you ask it at https://github.com/msgpack/msgpack-cli/issues ?

@kawanet kawanet closed this as completed Apr 10, 2016
@Almis90
Copy link
Author

Almis90 commented Apr 10, 2016

When I pack the object using this library and send it to c# client it succeeds to unpack it because I specify to which object I want to upack it var serializer = SerializationContext.Default.GetSerializer<Client>(); var client = serializer.Unpack(stream) I suppose this library should also have something similar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants