我有它的返回類型爲表轉換IEnumerable的到System.Data.Linq.Table
此代碼不能正常工作的功能。我只是想返回了IEnumerable作爲Linq.Table **
public static System.Data.Linq.Table<Products> GetProducts()
{
MyContext mc = new MyContext();
Table<Products> ret = null;
// Or Table<Products> ret = mc.GetTable<Products>();
ret.AttachAll<Products>(mc.GetTable<Products>()
.OrderBy(p => p.ProductID).Take(1));
return ret;
}
現在我想的IEnumerable查詢轉換爲System.Data.Linq.Table。
(你可能會說,我可以改變返回類型,但問題是,這是否是可能的。我可以覆蓋像GetTable()?某些功能)