I am trying the execute the sample code of LINQ to JSON (mentioned below) but it is giving me following error
Stack Trace:
[InvalidOperationException: Lambda Parameter not in scope]
Code I am executing is:
JObject rss =
new JObject(
new JProperty("id", "James Newton-King"),
new JProperty("name", "http://james.newtonking.com"),
new JProperty("data", "James Newton-King's blog."),
new JProperty("children",
new JArray(
from p in mwsysbot.Software
where p.SoftwareName == name
select new JObject(
new JProperty("id",p.SoftwareUUID),
new JProperty("name", p.SoftwareName)
)
)
)
);
Also when I remove line "new JProperty("name", p.SoftwareName) " the code executes perfectly.
I am not able to figure out why. Can someone please help me out ?
Let me know if you require more information ? Also can any one provide me some tutorial links to LINQ to JSON ?