I am working on .net 5 MVC project, try Linq to Entities. I want to get output as a Json. Is that possible in LINQ pad.
Install Newtonsoft.Json in nuget package manager, then:
Thanks sdflysha for quick reply. I tried as you explain. but i got this error after that. any idea how to solve this.
I found a solution for that.
Note: previously I use FirstOrDefaultAsync , then I change it to FirstOrDefault , Also modified SerializeObject() as in screenshot.
Anyone know how to get Json with FirstOrDefaultAsync() it would really appreciate.
Actually it's nothing to do with LINQPad, just await the FirstOrDefaultAsync() result, you'll get a correct result.