的方法時,如果你有一個返回值IEnumerable
的方法,但內返回IQueryable
會返回一個IEnumerable
力,即使IQueryable
推遲了執行的執行返回一個IEnumerable?查詢使用IQueryable的
public IEnumerable<Customer> Customers()
{
IEnumerable<Customer> customers = null;
try
{
customers = from c in GetCustomers // IQueryable
where c.Name=="JO"
select c;
}
catch (SqlException ex)
{
}
return customers;
}
http://msdn.microsoft.com/en-us/library/bb351562.aspx'公共接口IQueryable的:IEnumerable的, \t IQueryable的,IEnumerable' –
hunter
2011-05-23 17:11:25