1
我创建了一个以JSON格式返回数据的WCF Web服务。用于服务的代码如下:WCF服务JSON数据
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json)]
List<MyCustomer> GetCustomerJSON();
而且
public List<MyCustomer> GetCustomerJSON()
{
var nm = (from n in _ent.Customers
select new MyCustomer() { CustomerID = n.CustomerID, AccountNumber = n.AccountNumber }).Take(10);
return nm.ToList();
}
然而,输出不能很好地形成。它包括开始和结束的方括号。 因此,我无法使用Json Parser工具。 请帮忙。