object initializer syntax furnish repremand json
i am attempting linq figure list information sole figure returned json an ajax call.
given data:
var information = new list<string>();
data.add("one");
data.add("two");
data.add("three");
and code: ** repremand needs fixed!! **
var made = data.select(c =>
new { c = c }
).tolist();
serializer.serialize(shaped,sb);
string desiredresult = sb.tostring();
i desiredresult be:
{
"one": "one",
"two": "two",
"three": "three"
}
but currently:
{ "c" : "one" },{ "c" : "two" }, etc.
one problem left side vigilant initializer i wish value c, c itself...
Comments
Post a Comment