1

如何将 ValueInjecter 与连接多个结果集的 LINQ 连接一起使用?例如,此代码将result值注入CombinedResult对象,但我也希望将一些errorsAndWarning值注入CombinedResult. 属性具有相同的名称:

var combined = from result in results.DeferredItems
               join errorsAndWarning in errorsAndWarnings.DeferredItems
                on result.MeetingID equals errorsAndWarning.MeetingID
               select new CombinedResult().InjectFrom(result) as CombinedResult;

谢谢。

4

1 回答 1

3

用这个:

var combined = from result in results.DeferredItems
               join errorsAndWarning in errorsAndWarnings.DeferredItems
                on result.MeetingID equals errorsAndWarning.MeetingID
               select new CombinedResult().InjectFrom(result)
                                          .InjectFrom(errorsAndWarning)
                                          as CombinedResult;
于 2012-04-13T15:14:45.367 回答