lambda2js
lambda2js copied to clipboard
Support for List, Nested Object and Dictionary property initializers
This enhances MemberInitAsJson to support nested objects, lists, and dictionaries. Dictionary initializers aren't supported in Linq Expression Trees, so this supports a workaround format using the generic dictionary constructor that takes an IEnumerable<KVP> argument, so:
Dictionary = new Dictionary<string, object>(new[]{
new KeyValuePair<string, object>("One", 1),
new KeyValuePair<string, object>("Two", 2)
})
Also added a few unit tests to validate and demonstrate supported expression formats.