QueryableEx.Generated.cs 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq.Expressions;
  7. using System.Reflection;
  8. namespace System.Linq
  9. {
  10. public static partial class QueryableEx
  11. {
  12. private static MethodInfo s_Buffer__TSource__2__0;
  13. private static MethodInfo Buffer__TSource__2__0(Type TSource) =>
  14. (s_Buffer__TSource__2__0 ??
  15. (s_Buffer__TSource__2__0 = new Func<IQueryable<TSource>, int, IQueryable<IList<TSource>>>(Buffer<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  16. public static IQueryable<IList<TSource>> Buffer<TSource>(this IQueryable<TSource> source, int count)
  17. {
  18. if (source == null)
  19. throw new ArgumentNullException(nameof(source));
  20. return source.Provider.CreateQuery<IList<TSource>>(Expression.Call(Buffer__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
  21. }
  22. #pragma warning disable 1591
  23. [EditorBrowsable(EditorBrowsableState.Never)]
  24. public static IEnumerable<IList<TSource>> Buffer<TSource>(IEnumerable<TSource> source, int count)
  25. {
  26. #if REFERENCE_ASSEMBLY
  27. return default;
  28. #else
  29. return EnumerableEx.Buffer<TSource>(source, count);
  30. #endif
  31. }
  32. #pragma warning restore 1591
  33. private static MethodInfo s_Buffer__TSource__3__0;
  34. private static MethodInfo Buffer__TSource__3__0(Type TSource) =>
  35. (s_Buffer__TSource__3__0 ??
  36. (s_Buffer__TSource__3__0 = new Func<IQueryable<TSource>, int, int, IQueryable<IList<TSource>>>(Buffer<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  37. public static IQueryable<IList<TSource>> Buffer<TSource>(this IQueryable<TSource> source, int count, int skip)
  38. {
  39. if (source == null)
  40. throw new ArgumentNullException(nameof(source));
  41. return source.Provider.CreateQuery<IList<TSource>>(Expression.Call(Buffer__TSource__3__0(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int)), Expression.Constant(skip, typeof(int))));
  42. }
  43. #pragma warning disable 1591
  44. [EditorBrowsable(EditorBrowsableState.Never)]
  45. public static IEnumerable<IList<TSource>> Buffer<TSource>(IEnumerable<TSource> source, int count, int skip)
  46. {
  47. #if REFERENCE_ASSEMBLY
  48. return default;
  49. #else
  50. return EnumerableEx.Buffer<TSource>(source, count, skip);
  51. #endif
  52. }
  53. #pragma warning restore 1591
  54. private static MethodInfo s_Catch__TSource__1__0;
  55. private static MethodInfo Catch__TSource__1__0(Type TSource) =>
  56. (s_Catch__TSource__1__0 ??
  57. (s_Catch__TSource__1__0 = new Func<IQueryable<IEnumerable<TSource>>, IQueryable<TSource>>(Catch<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  58. public static IQueryable<TSource> Catch<TSource>(this IQueryable<IEnumerable<TSource>> sources)
  59. {
  60. if (sources == null)
  61. throw new ArgumentNullException(nameof(sources));
  62. return sources.Provider.CreateQuery<TSource>(Expression.Call(Catch__TSource__1__0(typeof(TSource)), sources.Expression));
  63. }
  64. #pragma warning disable 1591
  65. [EditorBrowsable(EditorBrowsableState.Never)]
  66. public static IEnumerable<TSource> Catch<TSource>(IEnumerable<IEnumerable<TSource>> sources)
  67. {
  68. #if REFERENCE_ASSEMBLY
  69. return default;
  70. #else
  71. return EnumerableEx.Catch<TSource>(sources);
  72. #endif
  73. }
  74. #pragma warning restore 1591
  75. private static MethodInfo s_Catch__TSource__2__0;
  76. private static MethodInfo Catch__TSource__2__0(Type TSource) =>
  77. (s_Catch__TSource__2__0 ??
  78. (s_Catch__TSource__2__0 = new Func<IQueryable<TSource>, IEnumerable<TSource>, IQueryable<TSource>>(Catch<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  79. public static IQueryable<TSource> Catch<TSource>(this IQueryable<TSource> first, IEnumerable<TSource> second)
  80. {
  81. if (first == null)
  82. throw new ArgumentNullException(nameof(first));
  83. if (second == null)
  84. throw new ArgumentNullException(nameof(second));
  85. return first.Provider.CreateQuery<TSource>(Expression.Call(Catch__TSource__2__0(typeof(TSource)), first.Expression, GetSourceExpression(second)));
  86. }
  87. #pragma warning disable 1591
  88. [EditorBrowsable(EditorBrowsableState.Never)]
  89. public static IEnumerable<TSource> Catch<TSource>(IEnumerable<TSource> first, IEnumerable<TSource> second)
  90. {
  91. #if REFERENCE_ASSEMBLY
  92. return default;
  93. #else
  94. return EnumerableEx.Catch<TSource>(first, second);
  95. #endif
  96. }
  97. #pragma warning restore 1591
  98. private static MethodInfo s_Catch__TSource_TException__2__0;
  99. private static MethodInfo Catch__TSource_TException__2__0(Type TSource, Type TException) =>
  100. (s_Catch__TSource_TException__2__0 ??
  101. (s_Catch__TSource_TException__2__0 = new Func<IQueryable<TSource>, Expression<Func<TException, IEnumerable<TSource>>>, IQueryable<TSource>>(Catch<TSource, TException>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TException);
  102. public static IQueryable<TSource> Catch<TSource, TException>(this IQueryable<TSource> source, Expression<Func<TException, IEnumerable<TSource>>> handler) where TException : Exception
  103. {
  104. if (source == null)
  105. throw new ArgumentNullException(nameof(source));
  106. if (handler == null)
  107. throw new ArgumentNullException(nameof(handler));
  108. return source.Provider.CreateQuery<TSource>(Expression.Call(Catch__TSource_TException__2__0(typeof(TSource), typeof(TException)), source.Expression, handler));
  109. }
  110. #pragma warning disable 1591
  111. [EditorBrowsable(EditorBrowsableState.Never)]
  112. public static IEnumerable<TSource> Catch<TSource, TException>(IEnumerable<TSource> source, Func<TException, IEnumerable<TSource>> handler) where TException : Exception
  113. {
  114. #if REFERENCE_ASSEMBLY
  115. return default;
  116. #else
  117. return EnumerableEx.Catch<TSource, TException>(source, handler);
  118. #endif
  119. }
  120. #pragma warning restore 1591
  121. private static MethodInfo s_Concat__TSource__1__0;
  122. private static MethodInfo Concat__TSource__1__0(Type TSource) =>
  123. (s_Concat__TSource__1__0 ??
  124. (s_Concat__TSource__1__0 = new Func<IQueryable<IEnumerable<TSource>>, IQueryable<TSource>>(Concat<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  125. public static IQueryable<TSource> Concat<TSource>(this IQueryable<IEnumerable<TSource>> sources)
  126. {
  127. if (sources == null)
  128. throw new ArgumentNullException(nameof(sources));
  129. return sources.Provider.CreateQuery<TSource>(Expression.Call(Concat__TSource__1__0(typeof(TSource)), sources.Expression));
  130. }
  131. #pragma warning disable 1591
  132. [EditorBrowsable(EditorBrowsableState.Never)]
  133. public static IEnumerable<TSource> Concat<TSource>(IEnumerable<IEnumerable<TSource>> sources)
  134. {
  135. #if REFERENCE_ASSEMBLY
  136. return default;
  137. #else
  138. return EnumerableEx.Concat<TSource>(sources);
  139. #endif
  140. }
  141. #pragma warning restore 1591
  142. private static MethodInfo s_Distinct__TSource_TKey__2__0;
  143. private static MethodInfo Distinct__TSource_TKey__2__0(Type TSource, Type TKey) =>
  144. (s_Distinct__TSource_TKey__2__0 ??
  145. (s_Distinct__TSource_TKey__2__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(Distinct<TSource, TKey>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);
  146. public static IQueryable<TSource> Distinct<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  147. {
  148. if (source == null)
  149. throw new ArgumentNullException(nameof(source));
  150. if (keySelector == null)
  151. throw new ArgumentNullException(nameof(keySelector));
  152. return source.Provider.CreateQuery<TSource>(Expression.Call(Distinct__TSource_TKey__2__0(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  153. }
  154. #pragma warning disable 1591
  155. [EditorBrowsable(EditorBrowsableState.Never)]
  156. public static IEnumerable<TSource> Distinct<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
  157. {
  158. #if REFERENCE_ASSEMBLY
  159. return default;
  160. #else
  161. return EnumerableEx.Distinct<TSource, TKey>(source, keySelector);
  162. #endif
  163. }
  164. #pragma warning restore 1591
  165. private static MethodInfo s_Distinct__TSource_TKey__3__0;
  166. private static MethodInfo Distinct__TSource_TKey__3__0(Type TSource, Type TKey) =>
  167. (s_Distinct__TSource_TKey__3__0 ??
  168. (s_Distinct__TSource_TKey__3__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(Distinct<TSource, TKey>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);
  169. public static IQueryable<TSource> Distinct<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
  170. {
  171. if (source == null)
  172. throw new ArgumentNullException(nameof(source));
  173. if (keySelector == null)
  174. throw new ArgumentNullException(nameof(keySelector));
  175. if (comparer == null)
  176. throw new ArgumentNullException(nameof(comparer));
  177. return source.Provider.CreateQuery<TSource>(Expression.Call(Distinct__TSource_TKey__3__0(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  178. }
  179. #pragma warning disable 1591
  180. [EditorBrowsable(EditorBrowsableState.Never)]
  181. public static IEnumerable<TSource> Distinct<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
  182. {
  183. #if REFERENCE_ASSEMBLY
  184. return default;
  185. #else
  186. return EnumerableEx.Distinct<TSource, TKey>(source, keySelector, comparer);
  187. #endif
  188. }
  189. #pragma warning restore 1591
  190. private static MethodInfo s_DistinctUntilChanged__TSource__1__0;
  191. private static MethodInfo DistinctUntilChanged__TSource__1__0(Type TSource) =>
  192. (s_DistinctUntilChanged__TSource__1__0 ??
  193. (s_DistinctUntilChanged__TSource__1__0 = new Func<IQueryable<TSource>, IQueryable<TSource>>(DistinctUntilChanged<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  194. public static IQueryable<TSource> DistinctUntilChanged<TSource>(this IQueryable<TSource> source)
  195. {
  196. if (source == null)
  197. throw new ArgumentNullException(nameof(source));
  198. return source.Provider.CreateQuery<TSource>(Expression.Call(DistinctUntilChanged__TSource__1__0(typeof(TSource)), source.Expression));
  199. }
  200. #pragma warning disable 1591
  201. [EditorBrowsable(EditorBrowsableState.Never)]
  202. public static IEnumerable<TSource> DistinctUntilChanged<TSource>(IEnumerable<TSource> source)
  203. {
  204. #if REFERENCE_ASSEMBLY
  205. return default;
  206. #else
  207. return EnumerableEx.DistinctUntilChanged<TSource>(source);
  208. #endif
  209. }
  210. #pragma warning restore 1591
  211. private static MethodInfo s_DistinctUntilChanged__TSource__2__0;
  212. private static MethodInfo DistinctUntilChanged__TSource__2__0(Type TSource) =>
  213. (s_DistinctUntilChanged__TSource__2__0 ??
  214. (s_DistinctUntilChanged__TSource__2__0 = new Func<IQueryable<TSource>, IEqualityComparer<TSource>, IQueryable<TSource>>(DistinctUntilChanged<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  215. public static IQueryable<TSource> DistinctUntilChanged<TSource>(this IQueryable<TSource> source, IEqualityComparer<TSource> comparer)
  216. {
  217. if (source == null)
  218. throw new ArgumentNullException(nameof(source));
  219. if (comparer == null)
  220. throw new ArgumentNullException(nameof(comparer));
  221. return source.Provider.CreateQuery<TSource>(Expression.Call(DistinctUntilChanged__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  222. }
  223. #pragma warning disable 1591
  224. [EditorBrowsable(EditorBrowsableState.Never)]
  225. public static IEnumerable<TSource> DistinctUntilChanged<TSource>(IEnumerable<TSource> source, IEqualityComparer<TSource> comparer)
  226. {
  227. #if REFERENCE_ASSEMBLY
  228. return default;
  229. #else
  230. return EnumerableEx.DistinctUntilChanged<TSource>(source, comparer);
  231. #endif
  232. }
  233. #pragma warning restore 1591
  234. private static MethodInfo s_DistinctUntilChanged__TSource_TKey__2__0;
  235. private static MethodInfo DistinctUntilChanged__TSource_TKey__2__0(Type TSource, Type TKey) =>
  236. (s_DistinctUntilChanged__TSource_TKey__2__0 ??
  237. (s_DistinctUntilChanged__TSource_TKey__2__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IQueryable<TSource>>(DistinctUntilChanged<TSource, TKey>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);
  238. public static IQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  239. {
  240. if (source == null)
  241. throw new ArgumentNullException(nameof(source));
  242. if (keySelector == null)
  243. throw new ArgumentNullException(nameof(keySelector));
  244. return source.Provider.CreateQuery<TSource>(Expression.Call(DistinctUntilChanged__TSource_TKey__2__0(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  245. }
  246. #pragma warning disable 1591
  247. [EditorBrowsable(EditorBrowsableState.Never)]
  248. public static IEnumerable<TSource> DistinctUntilChanged<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
  249. {
  250. #if REFERENCE_ASSEMBLY
  251. return default;
  252. #else
  253. return EnumerableEx.DistinctUntilChanged<TSource, TKey>(source, keySelector);
  254. #endif
  255. }
  256. #pragma warning restore 1591
  257. private static MethodInfo s_DistinctUntilChanged__TSource_TKey__3__0;
  258. private static MethodInfo DistinctUntilChanged__TSource_TKey__3__0(Type TSource, Type TKey) =>
  259. (s_DistinctUntilChanged__TSource_TKey__3__0 ??
  260. (s_DistinctUntilChanged__TSource_TKey__3__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IEqualityComparer<TKey>, IQueryable<TSource>>(DistinctUntilChanged<TSource, TKey>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);
  261. public static IQueryable<TSource> DistinctUntilChanged<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
  262. {
  263. if (source == null)
  264. throw new ArgumentNullException(nameof(source));
  265. if (keySelector == null)
  266. throw new ArgumentNullException(nameof(keySelector));
  267. if (comparer == null)
  268. throw new ArgumentNullException(nameof(comparer));
  269. return source.Provider.CreateQuery<TSource>(Expression.Call(DistinctUntilChanged__TSource_TKey__3__0(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  270. }
  271. #pragma warning disable 1591
  272. [EditorBrowsable(EditorBrowsableState.Never)]
  273. public static IEnumerable<TSource> DistinctUntilChanged<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
  274. {
  275. #if REFERENCE_ASSEMBLY
  276. return default;
  277. #else
  278. return EnumerableEx.DistinctUntilChanged<TSource, TKey>(source, keySelector, comparer);
  279. #endif
  280. }
  281. #pragma warning restore 1591
  282. private static MethodInfo s_Do__TSource__2__0;
  283. private static MethodInfo Do__TSource__2__0(Type TSource) =>
  284. (s_Do__TSource__2__0 ??
  285. (s_Do__TSource__2__0 = new Func<IQueryable<TSource>, Expression<Action<TSource>>, IQueryable<TSource>>(Do<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  286. public static IQueryable<TSource> Do<TSource>(this IQueryable<TSource> source, Expression<Action<TSource>> onNext)
  287. {
  288. if (source == null)
  289. throw new ArgumentNullException(nameof(source));
  290. if (onNext == null)
  291. throw new ArgumentNullException(nameof(onNext));
  292. return source.Provider.CreateQuery<TSource>(Expression.Call(Do__TSource__2__0(typeof(TSource)), source.Expression, onNext));
  293. }
  294. #pragma warning disable 1591
  295. [EditorBrowsable(EditorBrowsableState.Never)]
  296. public static IEnumerable<TSource> Do<TSource>(IEnumerable<TSource> source, Action<TSource> onNext)
  297. {
  298. #if REFERENCE_ASSEMBLY
  299. return default;
  300. #else
  301. return EnumerableEx.Do<TSource>(source, onNext);
  302. #endif
  303. }
  304. #pragma warning restore 1591
  305. private static MethodInfo s_Do__TSource__2__1;
  306. private static MethodInfo Do__TSource__2__1(Type TSource) =>
  307. (s_Do__TSource__2__1 ??
  308. (s_Do__TSource__2__1 = new Func<IQueryable<TSource>, IObserver<TSource>, IQueryable<TSource>>(Do<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  309. public static IQueryable<TSource> Do<TSource>(this IQueryable<TSource> source, IObserver<TSource> observer)
  310. {
  311. if (source == null)
  312. throw new ArgumentNullException(nameof(source));
  313. if (observer == null)
  314. throw new ArgumentNullException(nameof(observer));
  315. return source.Provider.CreateQuery<TSource>(Expression.Call(Do__TSource__2__1(typeof(TSource)), source.Expression, Expression.Constant(observer, typeof(IObserver<TSource>))));
  316. }
  317. #pragma warning disable 1591
  318. [EditorBrowsable(EditorBrowsableState.Never)]
  319. public static IEnumerable<TSource> Do<TSource>(IEnumerable<TSource> source, IObserver<TSource> observer)
  320. {
  321. #if REFERENCE_ASSEMBLY
  322. return default;
  323. #else
  324. return EnumerableEx.Do<TSource>(source, observer);
  325. #endif
  326. }
  327. #pragma warning restore 1591
  328. private static MethodInfo s_Do__TSource__3__0;
  329. private static MethodInfo Do__TSource__3__0(Type TSource) =>
  330. (s_Do__TSource__3__0 ??
  331. (s_Do__TSource__3__0 = new Func<IQueryable<TSource>, Expression<Action<TSource>>, Action, IQueryable<TSource>>(Do<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  332. public static IQueryable<TSource> Do<TSource>(this IQueryable<TSource> source, Expression<Action<TSource>> onNext, Action onCompleted)
  333. {
  334. if (source == null)
  335. throw new ArgumentNullException(nameof(source));
  336. if (onNext == null)
  337. throw new ArgumentNullException(nameof(onNext));
  338. if (onCompleted == null)
  339. throw new ArgumentNullException(nameof(onCompleted));
  340. return source.Provider.CreateQuery<TSource>(Expression.Call(Do__TSource__3__0(typeof(TSource)), source.Expression, onNext, Expression.Constant(onCompleted, typeof(Action))));
  341. }
  342. #pragma warning disable 1591
  343. [EditorBrowsable(EditorBrowsableState.Never)]
  344. public static IEnumerable<TSource> Do<TSource>(IEnumerable<TSource> source, Action<TSource> onNext, Action onCompleted)
  345. {
  346. #if REFERENCE_ASSEMBLY
  347. return default;
  348. #else
  349. return EnumerableEx.Do<TSource>(source, onNext, onCompleted);
  350. #endif
  351. }
  352. #pragma warning restore 1591
  353. private static MethodInfo s_Do__TSource__3__1;
  354. private static MethodInfo Do__TSource__3__1(Type TSource) =>
  355. (s_Do__TSource__3__1 ??
  356. (s_Do__TSource__3__1 = new Func<IQueryable<TSource>, Expression<Action<TSource>>, Expression<Action<Exception>>, IQueryable<TSource>>(Do<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  357. public static IQueryable<TSource> Do<TSource>(this IQueryable<TSource> source, Expression<Action<TSource>> onNext, Expression<Action<Exception>> onError)
  358. {
  359. if (source == null)
  360. throw new ArgumentNullException(nameof(source));
  361. if (onNext == null)
  362. throw new ArgumentNullException(nameof(onNext));
  363. if (onError == null)
  364. throw new ArgumentNullException(nameof(onError));
  365. return source.Provider.CreateQuery<TSource>(Expression.Call(Do__TSource__3__1(typeof(TSource)), source.Expression, onNext, onError));
  366. }
  367. #pragma warning disable 1591
  368. [EditorBrowsable(EditorBrowsableState.Never)]
  369. public static IEnumerable<TSource> Do<TSource>(IEnumerable<TSource> source, Action<TSource> onNext, Action<Exception> onError)
  370. {
  371. #if REFERENCE_ASSEMBLY
  372. return default;
  373. #else
  374. return EnumerableEx.Do<TSource>(source, onNext, onError);
  375. #endif
  376. }
  377. #pragma warning restore 1591
  378. private static MethodInfo s_Do__TSource__4__0;
  379. private static MethodInfo Do__TSource__4__0(Type TSource) =>
  380. (s_Do__TSource__4__0 ??
  381. (s_Do__TSource__4__0 = new Func<IQueryable<TSource>, Expression<Action<TSource>>, Expression<Action<Exception>>, Action, IQueryable<TSource>>(Do<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  382. public static IQueryable<TSource> Do<TSource>(this IQueryable<TSource> source, Expression<Action<TSource>> onNext, Expression<Action<Exception>> onError, Action onCompleted)
  383. {
  384. if (source == null)
  385. throw new ArgumentNullException(nameof(source));
  386. if (onNext == null)
  387. throw new ArgumentNullException(nameof(onNext));
  388. if (onError == null)
  389. throw new ArgumentNullException(nameof(onError));
  390. if (onCompleted == null)
  391. throw new ArgumentNullException(nameof(onCompleted));
  392. return source.Provider.CreateQuery<TSource>(Expression.Call(Do__TSource__4__0(typeof(TSource)), source.Expression, onNext, onError, Expression.Constant(onCompleted, typeof(Action))));
  393. }
  394. #pragma warning disable 1591
  395. [EditorBrowsable(EditorBrowsableState.Never)]
  396. public static IEnumerable<TSource> Do<TSource>(IEnumerable<TSource> source, Action<TSource> onNext, Action<Exception> onError, Action onCompleted)
  397. {
  398. #if REFERENCE_ASSEMBLY
  399. return default;
  400. #else
  401. return EnumerableEx.Do<TSource>(source, onNext, onError, onCompleted);
  402. #endif
  403. }
  404. #pragma warning restore 1591
  405. private static MethodInfo s_DoWhile__TResult__2__0;
  406. private static MethodInfo DoWhile__TResult__2__0(Type TResult) =>
  407. (s_DoWhile__TResult__2__0 ??
  408. (s_DoWhile__TResult__2__0 = new Func<IQueryable<TResult>, Expression<Func<bool>>, IQueryable<TResult>>(DoWhile<TResult>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TResult);
  409. public static IQueryable<TResult> DoWhile<TResult>(this IQueryable<TResult> source, Expression<Func<bool>> condition)
  410. {
  411. if (source == null)
  412. throw new ArgumentNullException(nameof(source));
  413. if (condition == null)
  414. throw new ArgumentNullException(nameof(condition));
  415. return source.Provider.CreateQuery<TResult>(Expression.Call(DoWhile__TResult__2__0(typeof(TResult)), source.Expression, condition));
  416. }
  417. #pragma warning disable 1591
  418. [EditorBrowsable(EditorBrowsableState.Never)]
  419. public static IEnumerable<TResult> DoWhile<TResult>(IEnumerable<TResult> source, Func<bool> condition)
  420. {
  421. #if REFERENCE_ASSEMBLY
  422. return default;
  423. #else
  424. return EnumerableEx.DoWhile<TResult>(source, condition);
  425. #endif
  426. }
  427. #pragma warning restore 1591
  428. private static MethodInfo s_Expand__TSource__2__0;
  429. private static MethodInfo Expand__TSource__2__0(Type TSource) =>
  430. (s_Expand__TSource__2__0 ??
  431. (s_Expand__TSource__2__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, IEnumerable<TSource>>>, IQueryable<TSource>>(Expand<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  432. public static IQueryable<TSource> Expand<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, IEnumerable<TSource>>> selector)
  433. {
  434. if (source == null)
  435. throw new ArgumentNullException(nameof(source));
  436. if (selector == null)
  437. throw new ArgumentNullException(nameof(selector));
  438. return source.Provider.CreateQuery<TSource>(Expression.Call(Expand__TSource__2__0(typeof(TSource)), source.Expression, selector));
  439. }
  440. #pragma warning disable 1591
  441. [EditorBrowsable(EditorBrowsableState.Never)]
  442. public static IEnumerable<TSource> Expand<TSource>(IEnumerable<TSource> source, Func<TSource, IEnumerable<TSource>> selector)
  443. {
  444. #if REFERENCE_ASSEMBLY
  445. return default;
  446. #else
  447. return EnumerableEx.Expand<TSource>(source, selector);
  448. #endif
  449. }
  450. #pragma warning restore 1591
  451. private static MethodInfo s_Finally__TSource__2__0;
  452. private static MethodInfo Finally__TSource__2__0(Type TSource) =>
  453. (s_Finally__TSource__2__0 ??
  454. (s_Finally__TSource__2__0 = new Func<IQueryable<TSource>, Action, IQueryable<TSource>>(Finally<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  455. public static IQueryable<TSource> Finally<TSource>(this IQueryable<TSource> source, Action finallyAction)
  456. {
  457. if (source == null)
  458. throw new ArgumentNullException(nameof(source));
  459. if (finallyAction == null)
  460. throw new ArgumentNullException(nameof(finallyAction));
  461. return source.Provider.CreateQuery<TSource>(Expression.Call(Finally__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(finallyAction, typeof(Action))));
  462. }
  463. #pragma warning disable 1591
  464. [EditorBrowsable(EditorBrowsableState.Never)]
  465. public static IEnumerable<TSource> Finally<TSource>(IEnumerable<TSource> source, Action finallyAction)
  466. {
  467. #if REFERENCE_ASSEMBLY
  468. return default;
  469. #else
  470. return EnumerableEx.Finally<TSource>(source, finallyAction);
  471. #endif
  472. }
  473. #pragma warning restore 1591
  474. private static MethodInfo s_Hide__TSource__1__0;
  475. private static MethodInfo Hide__TSource__1__0(Type TSource) =>
  476. (s_Hide__TSource__1__0 ??
  477. (s_Hide__TSource__1__0 = new Func<IQueryable<TSource>, IQueryable<TSource>>(Hide<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  478. public static IQueryable<TSource> Hide<TSource>(this IQueryable<TSource> source)
  479. {
  480. if (source == null)
  481. throw new ArgumentNullException(nameof(source));
  482. return source.Provider.CreateQuery<TSource>(Expression.Call(Hide__TSource__1__0(typeof(TSource)), source.Expression));
  483. }
  484. #pragma warning disable 1591
  485. [EditorBrowsable(EditorBrowsableState.Never)]
  486. public static IEnumerable<TSource> Hide<TSource>(IEnumerable<TSource> source)
  487. {
  488. #if REFERENCE_ASSEMBLY
  489. return default;
  490. #else
  491. return EnumerableEx.Hide<TSource>(source);
  492. #endif
  493. }
  494. #pragma warning restore 1591
  495. private static MethodInfo s_IgnoreElements__TSource__1__0;
  496. private static MethodInfo IgnoreElements__TSource__1__0(Type TSource) =>
  497. (s_IgnoreElements__TSource__1__0 ??
  498. (s_IgnoreElements__TSource__1__0 = new Func<IQueryable<TSource>, IQueryable<TSource>>(IgnoreElements<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  499. public static IQueryable<TSource> IgnoreElements<TSource>(this IQueryable<TSource> source)
  500. {
  501. if (source == null)
  502. throw new ArgumentNullException(nameof(source));
  503. return source.Provider.CreateQuery<TSource>(Expression.Call(IgnoreElements__TSource__1__0(typeof(TSource)), source.Expression));
  504. }
  505. #pragma warning disable 1591
  506. [EditorBrowsable(EditorBrowsableState.Never)]
  507. public static IEnumerable<TSource> IgnoreElements<TSource>(IEnumerable<TSource> source)
  508. {
  509. #if REFERENCE_ASSEMBLY
  510. return default;
  511. #else
  512. return EnumerableEx.IgnoreElements<TSource>(source);
  513. #endif
  514. }
  515. #pragma warning restore 1591
  516. private static MethodInfo s_IsEmpty__TSource__1__0;
  517. private static MethodInfo IsEmpty__TSource__1__0(Type TSource) =>
  518. (s_IsEmpty__TSource__1__0 ??
  519. (s_IsEmpty__TSource__1__0 = new Func<IQueryable<TSource>, bool>(IsEmpty<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  520. public static bool IsEmpty<TSource>(this IQueryable<TSource> source)
  521. {
  522. if (source == null)
  523. throw new ArgumentNullException(nameof(source));
  524. return source.Provider.Execute<bool>(Expression.Call(IsEmpty__TSource__1__0(typeof(TSource)), source.Expression));
  525. }
  526. #pragma warning disable 1591
  527. [EditorBrowsable(EditorBrowsableState.Never)]
  528. public static bool IsEmpty<TSource>(IEnumerable<TSource> source)
  529. {
  530. #if REFERENCE_ASSEMBLY
  531. return default;
  532. #else
  533. return EnumerableEx.IsEmpty<TSource>(source);
  534. #endif
  535. }
  536. #pragma warning restore 1591
  537. private static MethodInfo s_Max__TSource__2__0;
  538. private static MethodInfo Max__TSource__2__0(Type TSource) =>
  539. (s_Max__TSource__2__0 ??
  540. (s_Max__TSource__2__0 = new Func<IQueryable<TSource>, IComparer<TSource>, TSource>(Max<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  541. public static TSource Max<TSource>(this IQueryable<TSource> source, IComparer<TSource> comparer)
  542. {
  543. if (source == null)
  544. throw new ArgumentNullException(nameof(source));
  545. if (comparer == null)
  546. throw new ArgumentNullException(nameof(comparer));
  547. return source.Provider.Execute<TSource>(Expression.Call(Max__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer<TSource>))));
  548. }
  549. #pragma warning disable 1591
  550. [EditorBrowsable(EditorBrowsableState.Never)]
  551. public static TSource Max<TSource>(IEnumerable<TSource> source, IComparer<TSource> comparer)
  552. {
  553. #if REFERENCE_ASSEMBLY
  554. return default;
  555. #else
  556. return EnumerableEx.Max<TSource>(source, comparer);
  557. #endif
  558. }
  559. #pragma warning restore 1591
  560. private static MethodInfo s_MaxBy__TSource_TKey__2__0;
  561. private static MethodInfo MaxBy__TSource_TKey__2__0(Type TSource, Type TKey) =>
  562. (s_MaxBy__TSource_TKey__2__0 ??
  563. (s_MaxBy__TSource_TKey__2__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IList<TSource>>(MaxBy<TSource, TKey>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);
  564. public static IList<TSource> MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  565. {
  566. if (source == null)
  567. throw new ArgumentNullException(nameof(source));
  568. if (keySelector == null)
  569. throw new ArgumentNullException(nameof(keySelector));
  570. return source.Provider.Execute<IList<TSource>>(Expression.Call(MaxBy__TSource_TKey__2__0(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  571. }
  572. #pragma warning disable 1591
  573. [EditorBrowsable(EditorBrowsableState.Never)]
  574. public static IList<TSource> MaxBy<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
  575. {
  576. #if REFERENCE_ASSEMBLY
  577. return default;
  578. #else
  579. return EnumerableEx.MaxBy<TSource, TKey>(source, keySelector);
  580. #endif
  581. }
  582. #pragma warning restore 1591
  583. private static MethodInfo s_MaxBy__TSource_TKey__3__0;
  584. private static MethodInfo MaxBy__TSource_TKey__3__0(Type TSource, Type TKey) =>
  585. (s_MaxBy__TSource_TKey__3__0 ??
  586. (s_MaxBy__TSource_TKey__3__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IList<TSource>>(MaxBy<TSource, TKey>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);
  587. public static IList<TSource> MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
  588. {
  589. if (source == null)
  590. throw new ArgumentNullException(nameof(source));
  591. if (keySelector == null)
  592. throw new ArgumentNullException(nameof(keySelector));
  593. if (comparer == null)
  594. throw new ArgumentNullException(nameof(comparer));
  595. return source.Provider.Execute<IList<TSource>>(Expression.Call(MaxBy__TSource_TKey__3__0(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  596. }
  597. #pragma warning disable 1591
  598. [EditorBrowsable(EditorBrowsableState.Never)]
  599. public static IList<TSource> MaxBy<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer)
  600. {
  601. #if REFERENCE_ASSEMBLY
  602. return default;
  603. #else
  604. return EnumerableEx.MaxBy<TSource, TKey>(source, keySelector, comparer);
  605. #endif
  606. }
  607. #pragma warning restore 1591
  608. private static MethodInfo s_Memoize__TSource_TResult__2__0;
  609. private static MethodInfo Memoize__TSource_TResult__2__0(Type TSource, Type TResult) =>
  610. (s_Memoize__TSource_TResult__2__0 ??
  611. (s_Memoize__TSource_TResult__2__0 = new Func<IQueryable<TSource>, Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>>, IQueryable<TResult>>(Memoize<TSource, TResult>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TResult);
  612. public static IQueryable<TResult> Memoize<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>> selector)
  613. {
  614. if (source == null)
  615. throw new ArgumentNullException(nameof(source));
  616. if (selector == null)
  617. throw new ArgumentNullException(nameof(selector));
  618. return source.Provider.CreateQuery<TResult>(Expression.Call(Memoize__TSource_TResult__2__0(typeof(TSource), typeof(TResult)), source.Expression, selector));
  619. }
  620. #pragma warning disable 1591
  621. [EditorBrowsable(EditorBrowsableState.Never)]
  622. public static IEnumerable<TResult> Memoize<TSource, TResult>(IEnumerable<TSource> source, Func<IEnumerable<TSource>, IEnumerable<TResult>> selector)
  623. {
  624. #if REFERENCE_ASSEMBLY
  625. return default;
  626. #else
  627. return EnumerableEx.Memoize<TSource, TResult>(source, selector);
  628. #endif
  629. }
  630. #pragma warning restore 1591
  631. private static MethodInfo s_Memoize__TSource_TResult__3__0;
  632. private static MethodInfo Memoize__TSource_TResult__3__0(Type TSource, Type TResult) =>
  633. (s_Memoize__TSource_TResult__3__0 ??
  634. (s_Memoize__TSource_TResult__3__0 = new Func<IQueryable<TSource>, int, Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>>, IQueryable<TResult>>(Memoize<TSource, TResult>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TResult);
  635. public static IQueryable<TResult> Memoize<TSource, TResult>(this IQueryable<TSource> source, int readerCount, Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>> selector)
  636. {
  637. if (source == null)
  638. throw new ArgumentNullException(nameof(source));
  639. if (selector == null)
  640. throw new ArgumentNullException(nameof(selector));
  641. return source.Provider.CreateQuery<TResult>(Expression.Call(Memoize__TSource_TResult__3__0(typeof(TSource), typeof(TResult)), source.Expression, Expression.Constant(readerCount, typeof(int)), selector));
  642. }
  643. #pragma warning disable 1591
  644. [EditorBrowsable(EditorBrowsableState.Never)]
  645. public static IEnumerable<TResult> Memoize<TSource, TResult>(IEnumerable<TSource> source, int readerCount, Func<IEnumerable<TSource>, IEnumerable<TResult>> selector)
  646. {
  647. #if REFERENCE_ASSEMBLY
  648. return default;
  649. #else
  650. return EnumerableEx.Memoize<TSource, TResult>(source, readerCount, selector);
  651. #endif
  652. }
  653. #pragma warning restore 1591
  654. private static MethodInfo s_Min__TSource__2__0;
  655. private static MethodInfo Min__TSource__2__0(Type TSource) =>
  656. (s_Min__TSource__2__0 ??
  657. (s_Min__TSource__2__0 = new Func<IQueryable<TSource>, IComparer<TSource>, TSource>(Min<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  658. public static TSource Min<TSource>(this IQueryable<TSource> source, IComparer<TSource> comparer)
  659. {
  660. if (source == null)
  661. throw new ArgumentNullException(nameof(source));
  662. if (comparer == null)
  663. throw new ArgumentNullException(nameof(comparer));
  664. return source.Provider.Execute<TSource>(Expression.Call(Min__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IComparer<TSource>))));
  665. }
  666. #pragma warning disable 1591
  667. [EditorBrowsable(EditorBrowsableState.Never)]
  668. public static TSource Min<TSource>(IEnumerable<TSource> source, IComparer<TSource> comparer)
  669. {
  670. #if REFERENCE_ASSEMBLY
  671. return default;
  672. #else
  673. return EnumerableEx.Min<TSource>(source, comparer);
  674. #endif
  675. }
  676. #pragma warning restore 1591
  677. private static MethodInfo s_MinBy__TSource_TKey__2__0;
  678. private static MethodInfo MinBy__TSource_TKey__2__0(Type TSource, Type TKey) =>
  679. (s_MinBy__TSource_TKey__2__0 ??
  680. (s_MinBy__TSource_TKey__2__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IList<TSource>>(MinBy<TSource, TKey>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);
  681. public static IList<TSource> MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  682. {
  683. if (source == null)
  684. throw new ArgumentNullException(nameof(source));
  685. if (keySelector == null)
  686. throw new ArgumentNullException(nameof(keySelector));
  687. return source.Provider.Execute<IList<TSource>>(Expression.Call(MinBy__TSource_TKey__2__0(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  688. }
  689. #pragma warning disable 1591
  690. [EditorBrowsable(EditorBrowsableState.Never)]
  691. public static IList<TSource> MinBy<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
  692. {
  693. #if REFERENCE_ASSEMBLY
  694. return default;
  695. #else
  696. return EnumerableEx.MinBy<TSource, TKey>(source, keySelector);
  697. #endif
  698. }
  699. #pragma warning restore 1591
  700. private static MethodInfo s_MinBy__TSource_TKey__3__0;
  701. private static MethodInfo MinBy__TSource_TKey__3__0(Type TSource, Type TKey) =>
  702. (s_MinBy__TSource_TKey__3__0 ??
  703. (s_MinBy__TSource_TKey__3__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IList<TSource>>(MinBy<TSource, TKey>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TKey);
  704. public static IList<TSource> MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
  705. {
  706. if (source == null)
  707. throw new ArgumentNullException(nameof(source));
  708. if (keySelector == null)
  709. throw new ArgumentNullException(nameof(keySelector));
  710. if (comparer == null)
  711. throw new ArgumentNullException(nameof(comparer));
  712. return source.Provider.Execute<IList<TSource>>(Expression.Call(MinBy__TSource_TKey__3__0(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  713. }
  714. #pragma warning disable 1591
  715. [EditorBrowsable(EditorBrowsableState.Never)]
  716. public static IList<TSource> MinBy<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer)
  717. {
  718. #if REFERENCE_ASSEMBLY
  719. return default;
  720. #else
  721. return EnumerableEx.MinBy<TSource, TKey>(source, keySelector, comparer);
  722. #endif
  723. }
  724. #pragma warning restore 1591
  725. private static MethodInfo s_OnErrorResumeNext__TSource__1__0;
  726. private static MethodInfo OnErrorResumeNext__TSource__1__0(Type TSource) =>
  727. (s_OnErrorResumeNext__TSource__1__0 ??
  728. (s_OnErrorResumeNext__TSource__1__0 = new Func<IQueryable<IEnumerable<TSource>>, IQueryable<TSource>>(OnErrorResumeNext<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  729. public static IQueryable<TSource> OnErrorResumeNext<TSource>(this IQueryable<IEnumerable<TSource>> sources)
  730. {
  731. if (sources == null)
  732. throw new ArgumentNullException(nameof(sources));
  733. return sources.Provider.CreateQuery<TSource>(Expression.Call(OnErrorResumeNext__TSource__1__0(typeof(TSource)), sources.Expression));
  734. }
  735. #pragma warning disable 1591
  736. [EditorBrowsable(EditorBrowsableState.Never)]
  737. public static IEnumerable<TSource> OnErrorResumeNext<TSource>(IEnumerable<IEnumerable<TSource>> sources)
  738. {
  739. #if REFERENCE_ASSEMBLY
  740. return default;
  741. #else
  742. return EnumerableEx.OnErrorResumeNext<TSource>(sources);
  743. #endif
  744. }
  745. #pragma warning restore 1591
  746. private static MethodInfo s_OnErrorResumeNext__TSource__2__0;
  747. private static MethodInfo OnErrorResumeNext__TSource__2__0(Type TSource) =>
  748. (s_OnErrorResumeNext__TSource__2__0 ??
  749. (s_OnErrorResumeNext__TSource__2__0 = new Func<IQueryable<TSource>, IEnumerable<TSource>, IQueryable<TSource>>(OnErrorResumeNext<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  750. public static IQueryable<TSource> OnErrorResumeNext<TSource>(this IQueryable<TSource> first, IEnumerable<TSource> second)
  751. {
  752. if (first == null)
  753. throw new ArgumentNullException(nameof(first));
  754. if (second == null)
  755. throw new ArgumentNullException(nameof(second));
  756. return first.Provider.CreateQuery<TSource>(Expression.Call(OnErrorResumeNext__TSource__2__0(typeof(TSource)), first.Expression, GetSourceExpression(second)));
  757. }
  758. #pragma warning disable 1591
  759. [EditorBrowsable(EditorBrowsableState.Never)]
  760. public static IEnumerable<TSource> OnErrorResumeNext<TSource>(IEnumerable<TSource> first, IEnumerable<TSource> second)
  761. {
  762. #if REFERENCE_ASSEMBLY
  763. return default;
  764. #else
  765. return EnumerableEx.OnErrorResumeNext<TSource>(first, second);
  766. #endif
  767. }
  768. #pragma warning restore 1591
  769. private static MethodInfo s_Publish__TSource_TResult__2__0;
  770. private static MethodInfo Publish__TSource_TResult__2__0(Type TSource, Type TResult) =>
  771. (s_Publish__TSource_TResult__2__0 ??
  772. (s_Publish__TSource_TResult__2__0 = new Func<IQueryable<TSource>, Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>>, IQueryable<TResult>>(Publish<TSource, TResult>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TResult);
  773. public static IQueryable<TResult> Publish<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>> selector)
  774. {
  775. if (source == null)
  776. throw new ArgumentNullException(nameof(source));
  777. if (selector == null)
  778. throw new ArgumentNullException(nameof(selector));
  779. return source.Provider.CreateQuery<TResult>(Expression.Call(Publish__TSource_TResult__2__0(typeof(TSource), typeof(TResult)), source.Expression, selector));
  780. }
  781. #pragma warning disable 1591
  782. [EditorBrowsable(EditorBrowsableState.Never)]
  783. public static IEnumerable<TResult> Publish<TSource, TResult>(IEnumerable<TSource> source, Func<IEnumerable<TSource>, IEnumerable<TResult>> selector)
  784. {
  785. #if REFERENCE_ASSEMBLY
  786. return default;
  787. #else
  788. return EnumerableEx.Publish<TSource, TResult>(source, selector);
  789. #endif
  790. }
  791. #pragma warning restore 1591
  792. private static MethodInfo s_Repeat__TSource__1__0;
  793. private static MethodInfo Repeat__TSource__1__0(Type TSource) =>
  794. (s_Repeat__TSource__1__0 ??
  795. (s_Repeat__TSource__1__0 = new Func<IQueryable<TSource>, IQueryable<TSource>>(Repeat<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  796. public static IQueryable<TSource> Repeat<TSource>(this IQueryable<TSource> source)
  797. {
  798. if (source == null)
  799. throw new ArgumentNullException(nameof(source));
  800. return source.Provider.CreateQuery<TSource>(Expression.Call(Repeat__TSource__1__0(typeof(TSource)), source.Expression));
  801. }
  802. #pragma warning disable 1591
  803. [EditorBrowsable(EditorBrowsableState.Never)]
  804. public static IEnumerable<TSource> Repeat<TSource>(IEnumerable<TSource> source)
  805. {
  806. #if REFERENCE_ASSEMBLY
  807. return default;
  808. #else
  809. return EnumerableEx.Repeat<TSource>(source);
  810. #endif
  811. }
  812. #pragma warning restore 1591
  813. private static MethodInfo s_Repeat__TSource__2__0;
  814. private static MethodInfo Repeat__TSource__2__0(Type TSource) =>
  815. (s_Repeat__TSource__2__0 ??
  816. (s_Repeat__TSource__2__0 = new Func<IQueryable<TSource>, int, IQueryable<TSource>>(Repeat<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  817. public static IQueryable<TSource> Repeat<TSource>(this IQueryable<TSource> source, int count)
  818. {
  819. if (source == null)
  820. throw new ArgumentNullException(nameof(source));
  821. return source.Provider.CreateQuery<TSource>(Expression.Call(Repeat__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
  822. }
  823. #pragma warning disable 1591
  824. [EditorBrowsable(EditorBrowsableState.Never)]
  825. public static IEnumerable<TSource> Repeat<TSource>(IEnumerable<TSource> source, int count)
  826. {
  827. #if REFERENCE_ASSEMBLY
  828. return default;
  829. #else
  830. return EnumerableEx.Repeat<TSource>(source, count);
  831. #endif
  832. }
  833. #pragma warning restore 1591
  834. private static MethodInfo s_Retry__TSource__1__0;
  835. private static MethodInfo Retry__TSource__1__0(Type TSource) =>
  836. (s_Retry__TSource__1__0 ??
  837. (s_Retry__TSource__1__0 = new Func<IQueryable<TSource>, IQueryable<TSource>>(Retry<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  838. public static IQueryable<TSource> Retry<TSource>(this IQueryable<TSource> source)
  839. {
  840. if (source == null)
  841. throw new ArgumentNullException(nameof(source));
  842. return source.Provider.CreateQuery<TSource>(Expression.Call(Retry__TSource__1__0(typeof(TSource)), source.Expression));
  843. }
  844. #pragma warning disable 1591
  845. [EditorBrowsable(EditorBrowsableState.Never)]
  846. public static IEnumerable<TSource> Retry<TSource>(IEnumerable<TSource> source)
  847. {
  848. #if REFERENCE_ASSEMBLY
  849. return default;
  850. #else
  851. return EnumerableEx.Retry<TSource>(source);
  852. #endif
  853. }
  854. #pragma warning restore 1591
  855. private static MethodInfo s_Retry__TSource__2__0;
  856. private static MethodInfo Retry__TSource__2__0(Type TSource) =>
  857. (s_Retry__TSource__2__0 ??
  858. (s_Retry__TSource__2__0 = new Func<IQueryable<TSource>, int, IQueryable<TSource>>(Retry<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  859. public static IQueryable<TSource> Retry<TSource>(this IQueryable<TSource> source, int retryCount)
  860. {
  861. if (source == null)
  862. throw new ArgumentNullException(nameof(source));
  863. return source.Provider.CreateQuery<TSource>(Expression.Call(Retry__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(retryCount, typeof(int))));
  864. }
  865. #pragma warning disable 1591
  866. [EditorBrowsable(EditorBrowsableState.Never)]
  867. public static IEnumerable<TSource> Retry<TSource>(IEnumerable<TSource> source, int retryCount)
  868. {
  869. #if REFERENCE_ASSEMBLY
  870. return default;
  871. #else
  872. return EnumerableEx.Retry<TSource>(source, retryCount);
  873. #endif
  874. }
  875. #pragma warning restore 1591
  876. private static MethodInfo s_Scan__TSource__2__0;
  877. private static MethodInfo Scan__TSource__2__0(Type TSource) =>
  878. (s_Scan__TSource__2__0 ??
  879. (s_Scan__TSource__2__0 = new Func<IQueryable<TSource>, Expression<Func<TSource, TSource, TSource>>, IQueryable<TSource>>(Scan<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  880. public static IQueryable<TSource> Scan<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, TSource, TSource>> accumulator)
  881. {
  882. if (source == null)
  883. throw new ArgumentNullException(nameof(source));
  884. if (accumulator == null)
  885. throw new ArgumentNullException(nameof(accumulator));
  886. return source.Provider.CreateQuery<TSource>(Expression.Call(Scan__TSource__2__0(typeof(TSource)), source.Expression, accumulator));
  887. }
  888. #pragma warning disable 1591
  889. [EditorBrowsable(EditorBrowsableState.Never)]
  890. public static IEnumerable<TSource> Scan<TSource>(IEnumerable<TSource> source, Func<TSource, TSource, TSource> accumulator)
  891. {
  892. #if REFERENCE_ASSEMBLY
  893. return default;
  894. #else
  895. return EnumerableEx.Scan<TSource>(source, accumulator);
  896. #endif
  897. }
  898. #pragma warning restore 1591
  899. private static MethodInfo s_Scan__TSource_TAccumulate__3__0;
  900. private static MethodInfo Scan__TSource_TAccumulate__3__0(Type TSource, Type TAccumulate) =>
  901. (s_Scan__TSource_TAccumulate__3__0 ??
  902. (s_Scan__TSource_TAccumulate__3__0 = new Func<IQueryable<TSource>, TAccumulate, Expression<Func<TAccumulate, TSource, TAccumulate>>, IQueryable<TAccumulate>>(Scan<TSource, TAccumulate>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TAccumulate);
  903. public static IQueryable<TAccumulate> Scan<TSource, TAccumulate>(this IQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator)
  904. {
  905. if (source == null)
  906. throw new ArgumentNullException(nameof(source));
  907. if (accumulator == null)
  908. throw new ArgumentNullException(nameof(accumulator));
  909. return source.Provider.CreateQuery<TAccumulate>(Expression.Call(Scan__TSource_TAccumulate__3__0(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator));
  910. }
  911. #pragma warning disable 1591
  912. [EditorBrowsable(EditorBrowsableState.Never)]
  913. public static IEnumerable<TAccumulate> Scan<TSource, TAccumulate>(IEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> accumulator)
  914. {
  915. #if REFERENCE_ASSEMBLY
  916. return default;
  917. #else
  918. return EnumerableEx.Scan<TSource, TAccumulate>(source, seed, accumulator);
  919. #endif
  920. }
  921. #pragma warning restore 1591
  922. private static MethodInfo s_SelectMany__TSource_TOther__2__0;
  923. private static MethodInfo SelectMany__TSource_TOther__2__0(Type TSource, Type TOther) =>
  924. (s_SelectMany__TSource_TOther__2__0 ??
  925. (s_SelectMany__TSource_TOther__2__0 = new Func<IQueryable<TSource>, IEnumerable<TOther>, IQueryable<TOther>>(SelectMany<TSource, TOther>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TOther);
  926. public static IQueryable<TOther> SelectMany<TSource, TOther>(this IQueryable<TSource> source, IEnumerable<TOther> other)
  927. {
  928. if (source == null)
  929. throw new ArgumentNullException(nameof(source));
  930. if (other == null)
  931. throw new ArgumentNullException(nameof(other));
  932. return source.Provider.CreateQuery<TOther>(Expression.Call(SelectMany__TSource_TOther__2__0(typeof(TSource), typeof(TOther)), source.Expression, GetSourceExpression(other)));
  933. }
  934. #pragma warning disable 1591
  935. [EditorBrowsable(EditorBrowsableState.Never)]
  936. public static IEnumerable<TOther> SelectMany<TSource, TOther>(IEnumerable<TSource> source, IEnumerable<TOther> other)
  937. {
  938. #if REFERENCE_ASSEMBLY
  939. return default;
  940. #else
  941. return EnumerableEx.SelectMany<TSource, TOther>(source, other);
  942. #endif
  943. }
  944. #pragma warning restore 1591
  945. private static MethodInfo s_Share__TSource_TResult__2__0;
  946. private static MethodInfo Share__TSource_TResult__2__0(Type TSource, Type TResult) =>
  947. (s_Share__TSource_TResult__2__0 ??
  948. (s_Share__TSource_TResult__2__0 = new Func<IQueryable<TSource>, Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>>, IQueryable<TResult>>(Share<TSource, TResult>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource, TResult);
  949. public static IQueryable<TResult> Share<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<IEnumerable<TSource>, IEnumerable<TResult>>> selector)
  950. {
  951. if (source == null)
  952. throw new ArgumentNullException(nameof(source));
  953. if (selector == null)
  954. throw new ArgumentNullException(nameof(selector));
  955. return source.Provider.CreateQuery<TResult>(Expression.Call(Share__TSource_TResult__2__0(typeof(TSource), typeof(TResult)), source.Expression, selector));
  956. }
  957. #pragma warning disable 1591
  958. [EditorBrowsable(EditorBrowsableState.Never)]
  959. public static IEnumerable<TResult> Share<TSource, TResult>(IEnumerable<TSource> source, Func<IEnumerable<TSource>, IEnumerable<TResult>> selector)
  960. {
  961. #if REFERENCE_ASSEMBLY
  962. return default;
  963. #else
  964. return EnumerableEx.Share<TSource, TResult>(source, selector);
  965. #endif
  966. }
  967. #pragma warning restore 1591
  968. private static MethodInfo s_SkipLast__TSource__2__0;
  969. private static MethodInfo SkipLast__TSource__2__0(Type TSource) =>
  970. (s_SkipLast__TSource__2__0 ??
  971. (s_SkipLast__TSource__2__0 = new Func<IQueryable<TSource>, int, IQueryable<TSource>>(SkipLast<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  972. public static IQueryable<TSource> SkipLast<TSource>(this IQueryable<TSource> source, int count)
  973. {
  974. if (source == null)
  975. throw new ArgumentNullException(nameof(source));
  976. return source.Provider.CreateQuery<TSource>(Expression.Call(SkipLast__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
  977. }
  978. #pragma warning disable 1591
  979. [EditorBrowsable(EditorBrowsableState.Never)]
  980. public static IEnumerable<TSource> SkipLast<TSource>(IEnumerable<TSource> source, int count)
  981. {
  982. #if REFERENCE_ASSEMBLY
  983. return default;
  984. #else
  985. return EnumerableEx.SkipLast<TSource>(source, count);
  986. #endif
  987. }
  988. #pragma warning restore 1591
  989. private static MethodInfo s_StartWith__TSource__2__0;
  990. private static MethodInfo StartWith__TSource__2__0(Type TSource) =>
  991. (s_StartWith__TSource__2__0 ??
  992. (s_StartWith__TSource__2__0 = new Func<IQueryable<TSource>, TSource[], IQueryable<TSource>>(StartWith<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  993. public static IQueryable<TSource> StartWith<TSource>(this IQueryable<TSource> source, params TSource[] values)
  994. {
  995. if (source == null)
  996. throw new ArgumentNullException(nameof(source));
  997. if (values == null)
  998. throw new ArgumentNullException(nameof(values));
  999. return source.Provider.CreateQuery<TSource>(Expression.Call(StartWith__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(values, typeof(TSource[]))));
  1000. }
  1001. #pragma warning disable 1591
  1002. [EditorBrowsable(EditorBrowsableState.Never)]
  1003. public static IEnumerable<TSource> StartWith<TSource>(IEnumerable<TSource> source, TSource[] values)
  1004. {
  1005. #if REFERENCE_ASSEMBLY
  1006. return default;
  1007. #else
  1008. return EnumerableEx.StartWith<TSource>(source, values);
  1009. #endif
  1010. }
  1011. #pragma warning restore 1591
  1012. private static MethodInfo s_TakeLast__TSource__2__0;
  1013. private static MethodInfo TakeLast__TSource__2__0(Type TSource) =>
  1014. (s_TakeLast__TSource__2__0 ??
  1015. (s_TakeLast__TSource__2__0 = new Func<IQueryable<TSource>, int, IQueryable<TSource>>(TakeLast<TSource>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TSource);
  1016. public static IQueryable<TSource> TakeLast<TSource>(this IQueryable<TSource> source, int count)
  1017. {
  1018. if (source == null)
  1019. throw new ArgumentNullException(nameof(source));
  1020. return source.Provider.CreateQuery<TSource>(Expression.Call(TakeLast__TSource__2__0(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
  1021. }
  1022. #pragma warning disable 1591
  1023. [EditorBrowsable(EditorBrowsableState.Never)]
  1024. public static IEnumerable<TSource> TakeLast<TSource>(IEnumerable<TSource> source, int count)
  1025. {
  1026. #if REFERENCE_ASSEMBLY
  1027. return default;
  1028. #else
  1029. return EnumerableEx.TakeLast<TSource>(source, count);
  1030. #endif
  1031. }
  1032. #pragma warning restore 1591
  1033. }
  1034. }