【发布时间】:2015-12-30 00:39:58
【问题描述】:
我有 Web 服务和一个方法,它使用实体框架向我的表“客户”发出请求。
我想返回我的请求的结果:
public List<Customer> MyMethod(int id)
{
Model model = new Model();
List<Customer> customer = new List<Customer>();
try
{
customer = model.Customer.Where(x => x.Id == id).ToList();
}
catch(Exception ex)
{
throw new System.NullReferenceException();
}
return customer;
}
在调试模式下,我填写了一个列表,但是当我通过 SoapUI 调用该方法时,我没有答案。
谢谢
【问题讨论】:
-
所以在调试模式下,这会返回一个填充的
List<Customer>,但它在正常模式下不起作用,这意味着它返回一个空的List<Customer>? -
不,服务不返回任何内容。我在 SoapUI 上有一个空答案的信封