我正在构建一些 Linq 表达式并尝试获取 MethodInfo IEnumerable.DefaultIfEmpty
(http://msdn.microsoft.com/en-us/library/bb360179.aspx)。这似乎是一件容易的事,但我不知道为什么它不起作用。
typeof(Enumerable).GetMethod("DefaultIfEmpty", new[] { typeof(IEnumerable<>) });
typeof(Enumerable).GetMethod("DefaultIfEmpty", new[] { typeof(IEnumerable<>).MakeGenericType(typeof(WorkitemListModel)) });