Using invalid C # keyword name when exporting to JSON
I am using a third party api that expects JSON with keyword names like "key-name".
Using Entity Framework I am doing the following
var result = _context.data.Select(d => new
{
keyName = x.name
});
return Json(new {result = result});
Is there a way to use the corresponding value without replacing strings after manual generation?
+3
source to share