Hi Panel;
I have created a web API method called as GETStudedntDetails and I am returning value by JSON.
Bellow is my method;
public HttpResponseMessage Get(string id,string name) { string errormessage="" if(id==null) { errormessage="ENter ID"; flag=true } if(name==null) { errormessage="ENter name"; flag=true; } if(flag) { return content=new httpResponsemessage{ errormesage=errormessage } } }
In the above code I am checking with null value and if condtion satisfy I am returning error message .
But in JSON format the out put coming like this;
"ErrorMessage" : "Enter StudentName. Enter StudentRoll".
Is it possible to place each error separate line; and is it correct approach to do this ?
Thanks;
SK.