Reputation: 109
I have a plain and simple Linq to SQL query:
dim result = from c in ctx.customers select c
How can I use Newtonsoft.JSON to serialize the result using VB.NET (preferably) or c#?
As I'm lazy as a programmer, I don't want to create a class for the result because there will be many different queries (yes, downvote me... Make my day :-)
Upvotes: 1
Views: 1706
Reputation: 12538
Try using JsonConvert.SerializeObject
dim json = JsonConvert.SerializeObject(result)
Upvotes: 2