这是我的代码:
public DateTime GibSomeStartDate(IEnumerable<int> partnerNumbers, DateTime startTime)
{
var contractsStartDate = from contract in this.databaseContext.Contract
where partnerNumbers.Contains(contract.Pnr)
&& contract.SomeDateTime >= startTime
select contract.SomeDateTime;
}
如果我调用contractsStartDate.Min()
异常发生:
Unable to create a null constant value of type 'System.Collections.Generic.IEnumerable`1'. Only entity types, enumeration types or primitive types are supported in this context.
我的查询有什么问题?
是
contractsStartDate
类型System.Data.Entity.Infrastructure.DbQuery
英孚 5.0
databaseContext
是的孩子System.Data.Entity.DbContext