TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jeroen Everhard
NA
111
7.6k
Remove outer qoutes from JSON string
Oct 22 2020 7:23 AM
Hello,
I have a Controller in which I create a list and want to return this as JSON.
public
class
ItemsController : ApiController
{
public
IHttpActionResult GetItems(ODataQueryOptions<App4Sales_Items> opts)
{
//Code for filling list ommited
Dictionary<
string
, List<App4Sales_Items>> dic1 =
new
Dictionary<
string
, List<App4Sales_Items();
dic1.Add(
"Results"
, result);
JavaScriptSerializer js =
new
JavaScriptSerializer();
var test = js.Serialize(dic1);
return
Ok(test);
}
}
This returns the following JSON:
"{\"Results\":[{\"Id\":\"dc58d488-ab94-4c77-a11d-1cb135f7f2f4\"}]}"
But I would like:
{\"Results\":[{\"Id\":\"dc58d488-ab94-4c77-a11d-1cb135f7f2f4\"}]}, thus minus the most outer quotes.
How can I do that?
Jeroen
Reply
Answers (
4
)
how to make service reference for webservice that requires client cert
How to show a particular value from the SOAP Response in HTML asp.net