我試過這兩個,但沒有工作?怎麼做?SelectMany裏面SelectMany
.SelectMany(x => x.SectionEvents).SelectMany(t => t.Section)
.SelectMany(x => x.SectionEvents.SelectMany(t => t.Section))
錯誤:
的類型參數方法 '
System.Linq.Enumerable.SelectMany<TSource,TResult>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,System.Collections.Generic.IEnumerable<TResult>>)
' 不能從使用中推斷出來。嘗試明確指定類型參數 。
EEvent.List<EEvent>("CalendarPeriodUId", ECalendarPeriod.Current().UId).Value.ToList()
.SelectMany(x => x.SectionEvents.SelectMany(t => t.Section)).ToFCollection().Bind(ddlSection, "SectionName");
編譯器告訴你該怎麼做。 – 2014-09-05 06:33:30
請給出一個簡短但完整的例子。我不希望你必須指定類型參數。 – 2014-09-05 06:40:49
就是適合你的這個例子@Jon Skeet? – Mert 2014-09-05 06:52:50