返回后WCF客户端超时。我试过增加超时时间但是没有用。当我调试方法时没有问题。
有人有建议吗?
public List<Order> ProductsOfUser(string username, string password)
{
var user = container.UserSet.FirstOrDefault(u => (u.Username == username && u.Password == password));
if (user == null)
{
throw new Exception();
}
var resultuserId = user.Id;
Console.Out.WriteLine(resultuserId);
var orders3 = container.OrderSet.Where(o => o.UserId == user.Id).ToList();
return orders3;
}
这是linq创建的查询:
{SELECT
[Extent1].[Id] AS [Id],
[Extent1].[CustName] AS [CustName],
[Extent1].[OrderDate] AS [OrderDate]
,
[Extent1].[UserId] AS [UserId]
FROM [dbo].[OrderSet] AS [Extent1]}
答案 0 :(得分:0)
好的修好了
将[DataContract(IsReference = true)]添加到User类,现在一切顺利。