Skip to content

Instantly share code, notes, and snippets.

@danielwertheim
Created October 22, 2011 22:21
Show Gist options
  • Save danielwertheim/1306558 to your computer and use it in GitHub Desktop.
Save danielwertheim/1306558 to your computer and use it in GitHub Desktop.
ServiceStack ISet
JSON:
{"StructureId":"45748284fbfce011910a544249037e42","Names":{"First":"Daniel","Last":"Wertheim"},"Values":{"Value":{"Is":99},"Guid":"19adfa6da12748e09291aeb75e8ca23c","Int":42,"Long":142,"String":"String in ValuesContainer.","Double":1.33,"Decimal":3.14,"Bool":true},"NullValuesContainer":{"Guid":"60d977f995fc40fd9a7e6827e920370f","Int":42,"Long":142,"String":"String in NullValuesContainer.","Double":1.33,"Decimal":3.14,"Bool":true},"NullValuesContainerWithNulls":{},"ValuesInArray":[{"Is":1},{"Is":2},{"Is":3}],"ValuesInIList":[{"Is":31},{"Is":32},{"Is":33}],"ValuesInList":[{"Is":41},{"Is":42},{"Is":43}],"ValuesInISet":[{"Is":11},{"Is":12},{"Is":13}],"ValuesInHashSet":[{"Is":21},{"Is":22},{"Is":23}]}
NOTE! ValuesInIList is deserialized to member but ValuesInISet is not.
public class MyClass
{
public MyClass() {}
... ... ...
public IList<Value> ValuesInIList { get; set; }
public ISet<Value> ValuesInISet { get; set; }
... ... ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment