作者:手机用户2502876011 | 来源:互联网 | 2023-05-17 18:03
Imhavinganissuewiththefollowingcode:我遇到以下代码的问题:privatevoidDataPortal_Fetch(TaskCrit
I'm having an issue with the following code:
我遇到以下代码的问题:
private void DataPortal_Fetch(TaskCriteria criteria)
{
using (var ctx = ContextManager
.GetManager(Database.ApplicationConnection, false))
{
this.RaiseListChangedEvents = false;
this.IsReadOnly= false;
IQueryable query = ctx.DataContext.Tasks;
if (criteria.ReadyForPricing)
{
query = query.Where(row => row.IsPriced != true);
query = query.Where(row => row.Status == (int)TaskStatus.Closed);
query = query.Where(row => row.InvoiceId == Guid.Empty);
}
if (criteria.ReadyForInvoicing)
{
query = query.Where(row => row.IsPriced == true);
query = query.Where(row => row.Status == (int)TaskStatus.Closed);
query = query.Where(row => row.InvoiceId == Guid.Empty);
}
var data = query.Select(row => TaskInfo.FetchTaskInfo(row));
this.AddRange(data);
this.IsReadOnly= true;
this.RaiseListChangedEvents = true;
}
}
My web application, when it calls this method, always hangs if I don't comment out the following line:
我的Web应用程序,当它调用此方法时,如果我没有注释掉以下行,它总是挂起:
query = query.Where(row => row.InvoiceId == Guid.Empty
Any idea why this would be happening?
知道为什么会这样吗?
4 个解决方案