Skip to content
Discussion options

You must be logged in to vote

Like System.Text.Json, Nerdbank.MessagePack always treats types implementing IEnumerable as collections as oppposed to objects with properties. To get back the desired behavior you should either remove the IEnumerable implementation or manually set the type shape kind:

[TypeShape(Kind = TypeShapeKind.Object)]
public class MyDemoClass: IEnumerable
{
  /* implementation goes here */
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@AlleSchonWeg
Comment options

Answer selected by AlleSchonWeg
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants