Punit Sharma

Punit Sharma

  • NA
  • 101
  • 54.7k

WCF Rest Service

Nov 19 2015 2:56 AM
Dear All,
 
 
 I worked on wcf rest services. I am facing a problem that i send the result to user after converting the object value in string via: 
 List<object> val=new  List<object>(); val contains object of my any class
string _json = JsonConvert.SerializeObject(val);
jsonres.Response = Convert.ToString(enum_Response.Success);
jsonres.ResponseCode = Convert.ToString((int)enum_Response.Success);
jsonres.Value = _json;
 
 
in this Response ,ResponseCode and value are properties of  JsonResult class that have object jsonres
 
now the problem is that   jsonres.Value consists some extra char '\' so the other team used to DeserializeObject (jsonres.Value )  to get actual json..
so Is there any universe(that applicable for all classes object) way to send them direct json so that they  don't need to DeserializeObject at their app.
I go for genric but dont able to got solution.
 
Please Please suggest a way as soon as possible..
 
Thanks,
Punit Sharma 

Answers (4)