private IList<DiscountAndOptionalFeeItem> GetDiscountAndOptionalFees(IQueryable<Invoice> invoices)
{
// _context.Database.CommandTimeout = 50;
// Filter record based on isReversed and ChildID
var items = invoices.Where(p => p.ChildID != null && p.IsReversed == false)
.SelectMany(p => p.Items)
.Select(p => new
{
p.Invoice.CenterID,
p.Invoice.Center.CenterName,
p.InvoiceID,
p.Invoice.InvoiceDate,
p.Invoice.Child.ChildID,
p.Invoice.Child.FirstName,
p.Invoice.Child.LastName,
p.InvoiceItemID,
p.ItemAmount,
p.ItemDesc,
p.CenterChargeID,
p.CenterCharge.ChargeName,
p.Invoice.InvoiceTypeCD,
p.EnrolmentID,
p.ItemDate,
p.ItemType
}).ToArray();
执行此代码时出错。 请提示超时错误。 当我使用_context.Database.CommandTimeout = 100时; 在功能之上,然后可以正常工作,请提出另一种解决问题的方法