【发布时间】:2012-12-13 20:19:33
【问题描述】:
我有这个方法试图获取事物列表:
private static IQueryable<Thing> GetThings(int thingsType)
{
try
{
return from thing in entities.thing.Include("thingStuff")
select thing;
}
catch (Exception exception)
{
return new EnumerableQuery<Thing>(?????);
}
}
}
如果由于某种原因我无法运行查询,我想返回一个空的 IQueryable。我不想返回 NULL,因为这可能会破坏调用代码。这有可能还是我完全错了?
【问题讨论】:
标签: entity-framework