0
Select語句我有以下代碼:錯誤與Lambda表達式
getAllResult.GroupBy(g => g.OriginatingTransactionID)
.Select(r =>
{
usp_GetAll_Result getAllResult1 = r.Select(x => x).FirstOrDefault();
Bundle bundle = new Bundle
{
BundleName = getAllResult1.BundleName,
BundleStatusCode = getAllResult1.BundleStatusCode,
BundleStatusReasonCode = getAllResult1.BundleStatusReasonCode
};
}).ToList();
我得到的錯誤,而編譯:
類型參數的方法 「System.Linq.Enumerable。選擇(System.Collections.Generic.IEnumerable, System.Func)'不能根據用法推斷。嘗試明確指定類型參數 。
'Select'內的函數必須返回一個值,並且'Select'方法的返回類型將從返回值中推斷出來。 –