I am trying to use json.net to produce a web service but I am a bit perplexed as to why < string > is showing in the dummy data
[WebMethod]
public string getCustomerInfo(string IVACode)
{
var customerData = _dal.apertureAppstblCustomers.Where(a => a.IVACode == IVACode).ToList();
var jsonstring = JsonConvert.SerializeObject(customerData);
return jsonstring;
}
ie its starting like <string>
and ending </string>
how do i get it to display CustomerInformationinstead of string is it good practise to be naming the nodes?.
[{"id":"7aee450a-a9a7-4f19-83d3-467a3b8a39c0","IVACode":"IVA002","FirstName":"Peter","LastName":"Carson","AddressLine1":"Waters Edge Belfast","AddressLine2":null,"Town":"Belfast","County":"Down","PostCode":"BT99YXX","Telephone":null,"EmailAddress":"email","isActive":true,"authUserName":null,"authCreatedDate":null,"personalProgressValue":null,"contributionsToDate":null,"totalContributions":null,"totalArrears":50000.00,"totalPaid":null,"isDeleted":false,"deviceId":null,"deviceOs":null}]
<string></string>
element? What is the base class of your webservice? If you inspect jsonstring with the debugger before it is returned, does it contain that<string></string>
wrapper already? How do you test your method? – rene