AsyncQueryable.Generated.cs 538 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the Apache 2.0 License.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Collections.Generic;
  5. using System.Linq.Expressions;
  6. using System.Reflection;
  7. using System.Threading;
  8. using System.Threading.Tasks;
  9. namespace System.Linq
  10. {
  11. public static partial class AsyncQueryable
  12. {
  13. public static Task<TSource> AggregateAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TSource, TSource>> accumulator)
  14. {
  15. if (source == null)
  16. throw new ArgumentNullException(nameof(source));
  17. if (accumulator == null)
  18. throw new ArgumentNullException(nameof(accumulator));
  19. #if CRIPPLED_REFLECTION
  20. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TSource, TSource>>))), source.Expression, accumulator), CancellationToken.None);
  21. #else
  22. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator), CancellationToken.None);
  23. #endif
  24. }
  25. public static Task<TSource> AggregateAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TSource, ValueTask<TSource>>> accumulator)
  26. {
  27. if (source == null)
  28. throw new ArgumentNullException(nameof(source));
  29. if (accumulator == null)
  30. throw new ArgumentNullException(nameof(accumulator));
  31. #if CRIPPLED_REFLECTION
  32. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TSource, ValueTask<TSource>>>))), source.Expression, accumulator), CancellationToken.None);
  33. #else
  34. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator), CancellationToken.None);
  35. #endif
  36. }
  37. public static Task<TSource> AggregateAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TSource, CancellationToken, ValueTask<TSource>>> accumulator, CancellationToken cancellationToken)
  38. {
  39. if (source == null)
  40. throw new ArgumentNullException(nameof(source));
  41. if (accumulator == null)
  42. throw new ArgumentNullException(nameof(accumulator));
  43. #if CRIPPLED_REFLECTION
  44. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TSource, CancellationToken, ValueTask<TSource>>>), default(CancellationToken))), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  45. #else
  46. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  47. #endif
  48. }
  49. public static Task<TSource> AggregateAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TSource, TSource>> accumulator, CancellationToken cancellationToken)
  50. {
  51. if (source == null)
  52. throw new ArgumentNullException(nameof(source));
  53. if (accumulator == null)
  54. throw new ArgumentNullException(nameof(accumulator));
  55. #if CRIPPLED_REFLECTION
  56. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TSource, TSource>>), default(CancellationToken))), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  57. #else
  58. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  59. #endif
  60. }
  61. public static Task<TSource> AggregateAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TSource, ValueTask<TSource>>> accumulator, CancellationToken cancellationToken)
  62. {
  63. if (source == null)
  64. throw new ArgumentNullException(nameof(source));
  65. if (accumulator == null)
  66. throw new ArgumentNullException(nameof(accumulator));
  67. #if CRIPPLED_REFLECTION
  68. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TSource, ValueTask<TSource>>>), default(CancellationToken))), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  69. #else
  70. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  71. #endif
  72. }
  73. public static Task<TAccumulate> AggregateAsync<TSource, TAccumulate>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator)
  74. {
  75. if (source == null)
  76. throw new ArgumentNullException(nameof(source));
  77. if (accumulator == null)
  78. throw new ArgumentNullException(nameof(accumulator));
  79. #if CRIPPLED_REFLECTION
  80. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, TAccumulate>>))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator), CancellationToken.None);
  81. #else
  82. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator), CancellationToken.None);
  83. #endif
  84. }
  85. public static Task<TAccumulate> AggregateAsync<TSource, TAccumulate>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, ValueTask<TAccumulate>>> accumulator)
  86. {
  87. if (source == null)
  88. throw new ArgumentNullException(nameof(source));
  89. if (accumulator == null)
  90. throw new ArgumentNullException(nameof(accumulator));
  91. #if CRIPPLED_REFLECTION
  92. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, ValueTask<TAccumulate>>>))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator), CancellationToken.None);
  93. #else
  94. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator), CancellationToken.None);
  95. #endif
  96. }
  97. public static Task<TAccumulate> AggregateAsync<TSource, TAccumulate>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, CancellationToken, ValueTask<TAccumulate>>> accumulator, CancellationToken cancellationToken)
  98. {
  99. if (source == null)
  100. throw new ArgumentNullException(nameof(source));
  101. if (accumulator == null)
  102. throw new ArgumentNullException(nameof(accumulator));
  103. #if CRIPPLED_REFLECTION
  104. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, CancellationToken, ValueTask<TAccumulate>>>), default(CancellationToken))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  105. #else
  106. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  107. #endif
  108. }
  109. public static Task<TAccumulate> AggregateAsync<TSource, TAccumulate>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator, CancellationToken cancellationToken)
  110. {
  111. if (source == null)
  112. throw new ArgumentNullException(nameof(source));
  113. if (accumulator == null)
  114. throw new ArgumentNullException(nameof(accumulator));
  115. #if CRIPPLED_REFLECTION
  116. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, TAccumulate>>), default(CancellationToken))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  117. #else
  118. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  119. #endif
  120. }
  121. public static Task<TAccumulate> AggregateAsync<TSource, TAccumulate>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, ValueTask<TAccumulate>>> accumulator, CancellationToken cancellationToken)
  122. {
  123. if (source == null)
  124. throw new ArgumentNullException(nameof(source));
  125. if (accumulator == null)
  126. throw new ArgumentNullException(nameof(accumulator));
  127. #if CRIPPLED_REFLECTION
  128. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, ValueTask<TAccumulate>>>), default(CancellationToken))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  129. #else
  130. return source.Provider.ExecuteAsync<TAccumulate>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  131. #endif
  132. }
  133. public static Task<TResult> AggregateAsync<TSource, TAccumulate, TResult>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator, Expression<Func<TAccumulate, TResult>> resultSelector)
  134. {
  135. if (source == null)
  136. throw new ArgumentNullException(nameof(source));
  137. if (accumulator == null)
  138. throw new ArgumentNullException(nameof(accumulator));
  139. if (resultSelector == null)
  140. throw new ArgumentNullException(nameof(resultSelector));
  141. #if CRIPPLED_REFLECTION
  142. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate, TResult>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, TAccumulate>>), default(Expression<Func<TAccumulate, TResult>>))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector), CancellationToken.None);
  143. #else
  144. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector), CancellationToken.None);
  145. #endif
  146. }
  147. public static Task<TResult> AggregateAsync<TSource, TAccumulate, TResult>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, ValueTask<TAccumulate>>> accumulator, Expression<Func<TAccumulate, ValueTask<TResult>>> resultSelector)
  148. {
  149. if (source == null)
  150. throw new ArgumentNullException(nameof(source));
  151. if (accumulator == null)
  152. throw new ArgumentNullException(nameof(accumulator));
  153. if (resultSelector == null)
  154. throw new ArgumentNullException(nameof(resultSelector));
  155. #if CRIPPLED_REFLECTION
  156. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate, TResult>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, ValueTask<TAccumulate>>>), default(Expression<Func<TAccumulate, ValueTask<TResult>>>))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector), CancellationToken.None);
  157. #else
  158. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector), CancellationToken.None);
  159. #endif
  160. }
  161. public static Task<TResult> AggregateAsync<TSource, TAccumulate, TResult>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, CancellationToken, ValueTask<TAccumulate>>> accumulator, Expression<Func<TAccumulate, CancellationToken, ValueTask<TResult>>> resultSelector, CancellationToken cancellationToken)
  162. {
  163. if (source == null)
  164. throw new ArgumentNullException(nameof(source));
  165. if (accumulator == null)
  166. throw new ArgumentNullException(nameof(accumulator));
  167. if (resultSelector == null)
  168. throw new ArgumentNullException(nameof(resultSelector));
  169. #if CRIPPLED_REFLECTION
  170. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate, TResult>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, CancellationToken, ValueTask<TAccumulate>>>), default(Expression<Func<TAccumulate, CancellationToken, ValueTask<TResult>>>), default(CancellationToken))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  171. #else
  172. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  173. #endif
  174. }
  175. public static Task<TResult> AggregateAsync<TSource, TAccumulate, TResult>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, TAccumulate>> accumulator, Expression<Func<TAccumulate, TResult>> resultSelector, CancellationToken cancellationToken)
  176. {
  177. if (source == null)
  178. throw new ArgumentNullException(nameof(source));
  179. if (accumulator == null)
  180. throw new ArgumentNullException(nameof(accumulator));
  181. if (resultSelector == null)
  182. throw new ArgumentNullException(nameof(resultSelector));
  183. #if CRIPPLED_REFLECTION
  184. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate, TResult>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, TAccumulate>>), default(Expression<Func<TAccumulate, TResult>>), default(CancellationToken))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  185. #else
  186. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  187. #endif
  188. }
  189. public static Task<TResult> AggregateAsync<TSource, TAccumulate, TResult>(this IAsyncQueryable<TSource> source, TAccumulate seed, Expression<Func<TAccumulate, TSource, ValueTask<TAccumulate>>> accumulator, Expression<Func<TAccumulate, ValueTask<TResult>>> resultSelector, CancellationToken cancellationToken)
  190. {
  191. if (source == null)
  192. throw new ArgumentNullException(nameof(source));
  193. if (accumulator == null)
  194. throw new ArgumentNullException(nameof(accumulator));
  195. if (resultSelector == null)
  196. throw new ArgumentNullException(nameof(resultSelector));
  197. #if CRIPPLED_REFLECTION
  198. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.AggregateAsync<TSource, TAccumulate, TResult>(default(IAsyncQueryable<TSource>), default(TAccumulate), default(Expression<Func<TAccumulate, TSource, ValueTask<TAccumulate>>>), default(Expression<Func<TAccumulate, ValueTask<TResult>>>), default(CancellationToken))), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  199. #else
  200. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), source.Expression, Expression.Constant(seed, typeof(TAccumulate)), accumulator, resultSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  201. #endif
  202. }
  203. public static Task<bool> AllAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  204. {
  205. if (source == null)
  206. throw new ArgumentNullException(nameof(source));
  207. if (predicate == null)
  208. throw new ArgumentNullException(nameof(predicate));
  209. #if CRIPPLED_REFLECTION
  210. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AllAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  211. #else
  212. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  213. #endif
  214. }
  215. public static Task<bool> AllAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  216. {
  217. if (source == null)
  218. throw new ArgumentNullException(nameof(source));
  219. if (predicate == null)
  220. throw new ArgumentNullException(nameof(predicate));
  221. #if CRIPPLED_REFLECTION
  222. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AllAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  223. #else
  224. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  225. #endif
  226. }
  227. public static Task<bool> AllAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  228. {
  229. if (source == null)
  230. throw new ArgumentNullException(nameof(source));
  231. if (predicate == null)
  232. throw new ArgumentNullException(nameof(predicate));
  233. #if CRIPPLED_REFLECTION
  234. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AllAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  235. #else
  236. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  237. #endif
  238. }
  239. public static Task<bool> AllAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  240. {
  241. if (source == null)
  242. throw new ArgumentNullException(nameof(source));
  243. if (predicate == null)
  244. throw new ArgumentNullException(nameof(predicate));
  245. #if CRIPPLED_REFLECTION
  246. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AllAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  247. #else
  248. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  249. #endif
  250. }
  251. public static Task<bool> AllAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  252. {
  253. if (source == null)
  254. throw new ArgumentNullException(nameof(source));
  255. if (predicate == null)
  256. throw new ArgumentNullException(nameof(predicate));
  257. #if CRIPPLED_REFLECTION
  258. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AllAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  259. #else
  260. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  261. #endif
  262. }
  263. public static Task<bool> AnyAsync<TSource>(this IAsyncQueryable<TSource> source)
  264. {
  265. if (source == null)
  266. throw new ArgumentNullException(nameof(source));
  267. #if CRIPPLED_REFLECTION
  268. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AnyAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  269. #else
  270. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  271. #endif
  272. }
  273. public static Task<bool> AnyAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  274. {
  275. if (source == null)
  276. throw new ArgumentNullException(nameof(source));
  277. #if CRIPPLED_REFLECTION
  278. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AnyAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  279. #else
  280. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  281. #endif
  282. }
  283. public static Task<bool> AnyAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  284. {
  285. if (source == null)
  286. throw new ArgumentNullException(nameof(source));
  287. if (predicate == null)
  288. throw new ArgumentNullException(nameof(predicate));
  289. #if CRIPPLED_REFLECTION
  290. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AnyAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  291. #else
  292. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  293. #endif
  294. }
  295. public static Task<bool> AnyAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  296. {
  297. if (source == null)
  298. throw new ArgumentNullException(nameof(source));
  299. if (predicate == null)
  300. throw new ArgumentNullException(nameof(predicate));
  301. #if CRIPPLED_REFLECTION
  302. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AnyAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  303. #else
  304. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  305. #endif
  306. }
  307. public static Task<bool> AnyAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  308. {
  309. if (source == null)
  310. throw new ArgumentNullException(nameof(source));
  311. if (predicate == null)
  312. throw new ArgumentNullException(nameof(predicate));
  313. #if CRIPPLED_REFLECTION
  314. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AnyAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  315. #else
  316. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  317. #endif
  318. }
  319. public static Task<bool> AnyAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  320. {
  321. if (source == null)
  322. throw new ArgumentNullException(nameof(source));
  323. if (predicate == null)
  324. throw new ArgumentNullException(nameof(predicate));
  325. #if CRIPPLED_REFLECTION
  326. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AnyAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  327. #else
  328. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  329. #endif
  330. }
  331. public static Task<bool> AnyAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  332. {
  333. if (source == null)
  334. throw new ArgumentNullException(nameof(source));
  335. if (predicate == null)
  336. throw new ArgumentNullException(nameof(predicate));
  337. #if CRIPPLED_REFLECTION
  338. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.AnyAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  339. #else
  340. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  341. #endif
  342. }
  343. public static IAsyncQueryable<TSource> Append<TSource>(this IAsyncQueryable<TSource> source, TSource element)
  344. {
  345. if (source == null)
  346. throw new ArgumentNullException(nameof(source));
  347. #if CRIPPLED_REFLECTION
  348. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Append<TSource>(default(IAsyncQueryable<TSource>), default(TSource))), source.Expression, Expression.Constant(element, typeof(TSource))));
  349. #else
  350. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(element, typeof(TSource))));
  351. #endif
  352. }
  353. public static Task<decimal?> AverageAsync(this IAsyncQueryable<decimal?> source)
  354. {
  355. if (source == null)
  356. throw new ArgumentNullException(nameof(source));
  357. #if CRIPPLED_REFLECTION
  358. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<decimal?>))), source.Expression), CancellationToken.None);
  359. #else
  360. return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  361. #endif
  362. }
  363. public static Task<decimal> AverageAsync(this IAsyncQueryable<decimal> source)
  364. {
  365. if (source == null)
  366. throw new ArgumentNullException(nameof(source));
  367. #if CRIPPLED_REFLECTION
  368. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<decimal>))), source.Expression), CancellationToken.None);
  369. #else
  370. return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  371. #endif
  372. }
  373. public static Task<double?> AverageAsync(this IAsyncQueryable<double?> source)
  374. {
  375. if (source == null)
  376. throw new ArgumentNullException(nameof(source));
  377. #if CRIPPLED_REFLECTION
  378. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<double?>))), source.Expression), CancellationToken.None);
  379. #else
  380. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  381. #endif
  382. }
  383. public static Task<double> AverageAsync(this IAsyncQueryable<double> source)
  384. {
  385. if (source == null)
  386. throw new ArgumentNullException(nameof(source));
  387. #if CRIPPLED_REFLECTION
  388. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<double>))), source.Expression), CancellationToken.None);
  389. #else
  390. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  391. #endif
  392. }
  393. public static Task<float?> AverageAsync(this IAsyncQueryable<float?> source)
  394. {
  395. if (source == null)
  396. throw new ArgumentNullException(nameof(source));
  397. #if CRIPPLED_REFLECTION
  398. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<float?>))), source.Expression), CancellationToken.None);
  399. #else
  400. return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  401. #endif
  402. }
  403. public static Task<float> AverageAsync(this IAsyncQueryable<float> source)
  404. {
  405. if (source == null)
  406. throw new ArgumentNullException(nameof(source));
  407. #if CRIPPLED_REFLECTION
  408. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<float>))), source.Expression), CancellationToken.None);
  409. #else
  410. return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  411. #endif
  412. }
  413. public static Task<double?> AverageAsync(this IAsyncQueryable<int?> source)
  414. {
  415. if (source == null)
  416. throw new ArgumentNullException(nameof(source));
  417. #if CRIPPLED_REFLECTION
  418. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<int?>))), source.Expression), CancellationToken.None);
  419. #else
  420. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  421. #endif
  422. }
  423. public static Task<double> AverageAsync(this IAsyncQueryable<int> source)
  424. {
  425. if (source == null)
  426. throw new ArgumentNullException(nameof(source));
  427. #if CRIPPLED_REFLECTION
  428. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<int>))), source.Expression), CancellationToken.None);
  429. #else
  430. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  431. #endif
  432. }
  433. public static Task<double?> AverageAsync(this IAsyncQueryable<long?> source)
  434. {
  435. if (source == null)
  436. throw new ArgumentNullException(nameof(source));
  437. #if CRIPPLED_REFLECTION
  438. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<long?>))), source.Expression), CancellationToken.None);
  439. #else
  440. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  441. #endif
  442. }
  443. public static Task<double> AverageAsync(this IAsyncQueryable<long> source)
  444. {
  445. if (source == null)
  446. throw new ArgumentNullException(nameof(source));
  447. #if CRIPPLED_REFLECTION
  448. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<long>))), source.Expression), CancellationToken.None);
  449. #else
  450. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  451. #endif
  452. }
  453. public static Task<decimal?> AverageAsync(this IAsyncQueryable<decimal?> source, CancellationToken cancellationToken)
  454. {
  455. if (source == null)
  456. throw new ArgumentNullException(nameof(source));
  457. #if CRIPPLED_REFLECTION
  458. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<decimal?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  459. #else
  460. return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  461. #endif
  462. }
  463. public static Task<decimal> AverageAsync(this IAsyncQueryable<decimal> source, CancellationToken cancellationToken)
  464. {
  465. if (source == null)
  466. throw new ArgumentNullException(nameof(source));
  467. #if CRIPPLED_REFLECTION
  468. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<decimal>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  469. #else
  470. return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  471. #endif
  472. }
  473. public static Task<double?> AverageAsync(this IAsyncQueryable<double?> source, CancellationToken cancellationToken)
  474. {
  475. if (source == null)
  476. throw new ArgumentNullException(nameof(source));
  477. #if CRIPPLED_REFLECTION
  478. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<double?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  479. #else
  480. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  481. #endif
  482. }
  483. public static Task<double> AverageAsync(this IAsyncQueryable<double> source, CancellationToken cancellationToken)
  484. {
  485. if (source == null)
  486. throw new ArgumentNullException(nameof(source));
  487. #if CRIPPLED_REFLECTION
  488. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<double>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  489. #else
  490. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  491. #endif
  492. }
  493. public static Task<float?> AverageAsync(this IAsyncQueryable<float?> source, CancellationToken cancellationToken)
  494. {
  495. if (source == null)
  496. throw new ArgumentNullException(nameof(source));
  497. #if CRIPPLED_REFLECTION
  498. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<float?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  499. #else
  500. return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  501. #endif
  502. }
  503. public static Task<float> AverageAsync(this IAsyncQueryable<float> source, CancellationToken cancellationToken)
  504. {
  505. if (source == null)
  506. throw new ArgumentNullException(nameof(source));
  507. #if CRIPPLED_REFLECTION
  508. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<float>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  509. #else
  510. return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  511. #endif
  512. }
  513. public static Task<double?> AverageAsync(this IAsyncQueryable<int?> source, CancellationToken cancellationToken)
  514. {
  515. if (source == null)
  516. throw new ArgumentNullException(nameof(source));
  517. #if CRIPPLED_REFLECTION
  518. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<int?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  519. #else
  520. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  521. #endif
  522. }
  523. public static Task<double> AverageAsync(this IAsyncQueryable<int> source, CancellationToken cancellationToken)
  524. {
  525. if (source == null)
  526. throw new ArgumentNullException(nameof(source));
  527. #if CRIPPLED_REFLECTION
  528. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<int>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  529. #else
  530. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  531. #endif
  532. }
  533. public static Task<double?> AverageAsync(this IAsyncQueryable<long?> source, CancellationToken cancellationToken)
  534. {
  535. if (source == null)
  536. throw new ArgumentNullException(nameof(source));
  537. #if CRIPPLED_REFLECTION
  538. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<long?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  539. #else
  540. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  541. #endif
  542. }
  543. public static Task<double> AverageAsync(this IAsyncQueryable<long> source, CancellationToken cancellationToken)
  544. {
  545. if (source == null)
  546. throw new ArgumentNullException(nameof(source));
  547. #if CRIPPLED_REFLECTION
  548. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync(default(IAsyncQueryable<long>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  549. #else
  550. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  551. #endif
  552. }
  553. public static Task<decimal?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
  554. {
  555. if (source == null)
  556. throw new ArgumentNullException(nameof(source));
  557. if (selector == null)
  558. throw new ArgumentNullException(nameof(selector));
  559. #if CRIPPLED_REFLECTION
  560. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal?>>))), source.Expression, selector), CancellationToken.None);
  561. #else
  562. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  563. #endif
  564. }
  565. public static Task<decimal> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
  566. {
  567. if (source == null)
  568. throw new ArgumentNullException(nameof(source));
  569. if (selector == null)
  570. throw new ArgumentNullException(nameof(selector));
  571. #if CRIPPLED_REFLECTION
  572. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal>>))), source.Expression, selector), CancellationToken.None);
  573. #else
  574. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  575. #endif
  576. }
  577. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
  578. {
  579. if (source == null)
  580. throw new ArgumentNullException(nameof(source));
  581. if (selector == null)
  582. throw new ArgumentNullException(nameof(selector));
  583. #if CRIPPLED_REFLECTION
  584. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double?>>))), source.Expression, selector), CancellationToken.None);
  585. #else
  586. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  587. #endif
  588. }
  589. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector)
  590. {
  591. if (source == null)
  592. throw new ArgumentNullException(nameof(source));
  593. if (selector == null)
  594. throw new ArgumentNullException(nameof(selector));
  595. #if CRIPPLED_REFLECTION
  596. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double>>))), source.Expression, selector), CancellationToken.None);
  597. #else
  598. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  599. #endif
  600. }
  601. public static Task<float?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
  602. {
  603. if (source == null)
  604. throw new ArgumentNullException(nameof(source));
  605. if (selector == null)
  606. throw new ArgumentNullException(nameof(selector));
  607. #if CRIPPLED_REFLECTION
  608. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float?>>))), source.Expression, selector), CancellationToken.None);
  609. #else
  610. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  611. #endif
  612. }
  613. public static Task<float> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector)
  614. {
  615. if (source == null)
  616. throw new ArgumentNullException(nameof(source));
  617. if (selector == null)
  618. throw new ArgumentNullException(nameof(selector));
  619. #if CRIPPLED_REFLECTION
  620. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float>>))), source.Expression, selector), CancellationToken.None);
  621. #else
  622. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  623. #endif
  624. }
  625. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
  626. {
  627. if (source == null)
  628. throw new ArgumentNullException(nameof(source));
  629. if (selector == null)
  630. throw new ArgumentNullException(nameof(selector));
  631. #if CRIPPLED_REFLECTION
  632. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int?>>))), source.Expression, selector), CancellationToken.None);
  633. #else
  634. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  635. #endif
  636. }
  637. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector)
  638. {
  639. if (source == null)
  640. throw new ArgumentNullException(nameof(source));
  641. if (selector == null)
  642. throw new ArgumentNullException(nameof(selector));
  643. #if CRIPPLED_REFLECTION
  644. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int>>))), source.Expression, selector), CancellationToken.None);
  645. #else
  646. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  647. #endif
  648. }
  649. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
  650. {
  651. if (source == null)
  652. throw new ArgumentNullException(nameof(source));
  653. if (selector == null)
  654. throw new ArgumentNullException(nameof(selector));
  655. #if CRIPPLED_REFLECTION
  656. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long?>>))), source.Expression, selector), CancellationToken.None);
  657. #else
  658. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  659. #endif
  660. }
  661. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector)
  662. {
  663. if (source == null)
  664. throw new ArgumentNullException(nameof(source));
  665. if (selector == null)
  666. throw new ArgumentNullException(nameof(selector));
  667. #if CRIPPLED_REFLECTION
  668. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long>>))), source.Expression, selector), CancellationToken.None);
  669. #else
  670. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  671. #endif
  672. }
  673. public static Task<decimal?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal?>>> selector)
  674. {
  675. if (source == null)
  676. throw new ArgumentNullException(nameof(source));
  677. if (selector == null)
  678. throw new ArgumentNullException(nameof(selector));
  679. #if CRIPPLED_REFLECTION
  680. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal?>>>))), source.Expression, selector), CancellationToken.None);
  681. #else
  682. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  683. #endif
  684. }
  685. public static Task<decimal> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal>>> selector)
  686. {
  687. if (source == null)
  688. throw new ArgumentNullException(nameof(source));
  689. if (selector == null)
  690. throw new ArgumentNullException(nameof(selector));
  691. #if CRIPPLED_REFLECTION
  692. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal>>>))), source.Expression, selector), CancellationToken.None);
  693. #else
  694. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  695. #endif
  696. }
  697. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double?>>> selector)
  698. {
  699. if (source == null)
  700. throw new ArgumentNullException(nameof(source));
  701. if (selector == null)
  702. throw new ArgumentNullException(nameof(selector));
  703. #if CRIPPLED_REFLECTION
  704. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double?>>>))), source.Expression, selector), CancellationToken.None);
  705. #else
  706. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  707. #endif
  708. }
  709. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double>>> selector)
  710. {
  711. if (source == null)
  712. throw new ArgumentNullException(nameof(source));
  713. if (selector == null)
  714. throw new ArgumentNullException(nameof(selector));
  715. #if CRIPPLED_REFLECTION
  716. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double>>>))), source.Expression, selector), CancellationToken.None);
  717. #else
  718. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  719. #endif
  720. }
  721. public static Task<float?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float?>>> selector)
  722. {
  723. if (source == null)
  724. throw new ArgumentNullException(nameof(source));
  725. if (selector == null)
  726. throw new ArgumentNullException(nameof(selector));
  727. #if CRIPPLED_REFLECTION
  728. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float?>>>))), source.Expression, selector), CancellationToken.None);
  729. #else
  730. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  731. #endif
  732. }
  733. public static Task<float> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float>>> selector)
  734. {
  735. if (source == null)
  736. throw new ArgumentNullException(nameof(source));
  737. if (selector == null)
  738. throw new ArgumentNullException(nameof(selector));
  739. #if CRIPPLED_REFLECTION
  740. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float>>>))), source.Expression, selector), CancellationToken.None);
  741. #else
  742. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  743. #endif
  744. }
  745. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int?>>> selector)
  746. {
  747. if (source == null)
  748. throw new ArgumentNullException(nameof(source));
  749. if (selector == null)
  750. throw new ArgumentNullException(nameof(selector));
  751. #if CRIPPLED_REFLECTION
  752. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int?>>>))), source.Expression, selector), CancellationToken.None);
  753. #else
  754. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  755. #endif
  756. }
  757. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int>>> selector)
  758. {
  759. if (source == null)
  760. throw new ArgumentNullException(nameof(source));
  761. if (selector == null)
  762. throw new ArgumentNullException(nameof(selector));
  763. #if CRIPPLED_REFLECTION
  764. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int>>>))), source.Expression, selector), CancellationToken.None);
  765. #else
  766. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  767. #endif
  768. }
  769. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long?>>> selector)
  770. {
  771. if (source == null)
  772. throw new ArgumentNullException(nameof(source));
  773. if (selector == null)
  774. throw new ArgumentNullException(nameof(selector));
  775. #if CRIPPLED_REFLECTION
  776. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long?>>>))), source.Expression, selector), CancellationToken.None);
  777. #else
  778. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  779. #endif
  780. }
  781. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long>>> selector)
  782. {
  783. if (source == null)
  784. throw new ArgumentNullException(nameof(source));
  785. if (selector == null)
  786. throw new ArgumentNullException(nameof(selector));
  787. #if CRIPPLED_REFLECTION
  788. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long>>>))), source.Expression, selector), CancellationToken.None);
  789. #else
  790. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  791. #endif
  792. }
  793. public static Task<decimal?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<decimal?>>> selector, CancellationToken cancellationToken)
  794. {
  795. if (source == null)
  796. throw new ArgumentNullException(nameof(source));
  797. if (selector == null)
  798. throw new ArgumentNullException(nameof(selector));
  799. #if CRIPPLED_REFLECTION
  800. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<decimal?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  801. #else
  802. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  803. #endif
  804. }
  805. public static Task<decimal> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<decimal>>> selector, CancellationToken cancellationToken)
  806. {
  807. if (source == null)
  808. throw new ArgumentNullException(nameof(source));
  809. if (selector == null)
  810. throw new ArgumentNullException(nameof(selector));
  811. #if CRIPPLED_REFLECTION
  812. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<decimal>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  813. #else
  814. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  815. #endif
  816. }
  817. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<double?>>> selector, CancellationToken cancellationToken)
  818. {
  819. if (source == null)
  820. throw new ArgumentNullException(nameof(source));
  821. if (selector == null)
  822. throw new ArgumentNullException(nameof(selector));
  823. #if CRIPPLED_REFLECTION
  824. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<double?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  825. #else
  826. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  827. #endif
  828. }
  829. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<double>>> selector, CancellationToken cancellationToken)
  830. {
  831. if (source == null)
  832. throw new ArgumentNullException(nameof(source));
  833. if (selector == null)
  834. throw new ArgumentNullException(nameof(selector));
  835. #if CRIPPLED_REFLECTION
  836. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<double>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  837. #else
  838. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  839. #endif
  840. }
  841. public static Task<float?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<float?>>> selector, CancellationToken cancellationToken)
  842. {
  843. if (source == null)
  844. throw new ArgumentNullException(nameof(source));
  845. if (selector == null)
  846. throw new ArgumentNullException(nameof(selector));
  847. #if CRIPPLED_REFLECTION
  848. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<float?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  849. #else
  850. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  851. #endif
  852. }
  853. public static Task<float> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<float>>> selector, CancellationToken cancellationToken)
  854. {
  855. if (source == null)
  856. throw new ArgumentNullException(nameof(source));
  857. if (selector == null)
  858. throw new ArgumentNullException(nameof(selector));
  859. #if CRIPPLED_REFLECTION
  860. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<float>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  861. #else
  862. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  863. #endif
  864. }
  865. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<int?>>> selector, CancellationToken cancellationToken)
  866. {
  867. if (source == null)
  868. throw new ArgumentNullException(nameof(source));
  869. if (selector == null)
  870. throw new ArgumentNullException(nameof(selector));
  871. #if CRIPPLED_REFLECTION
  872. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<int?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  873. #else
  874. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  875. #endif
  876. }
  877. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<int>>> selector, CancellationToken cancellationToken)
  878. {
  879. if (source == null)
  880. throw new ArgumentNullException(nameof(source));
  881. if (selector == null)
  882. throw new ArgumentNullException(nameof(selector));
  883. #if CRIPPLED_REFLECTION
  884. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<int>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  885. #else
  886. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  887. #endif
  888. }
  889. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<long?>>> selector, CancellationToken cancellationToken)
  890. {
  891. if (source == null)
  892. throw new ArgumentNullException(nameof(source));
  893. if (selector == null)
  894. throw new ArgumentNullException(nameof(selector));
  895. #if CRIPPLED_REFLECTION
  896. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<long?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  897. #else
  898. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  899. #endif
  900. }
  901. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<long>>> selector, CancellationToken cancellationToken)
  902. {
  903. if (source == null)
  904. throw new ArgumentNullException(nameof(source));
  905. if (selector == null)
  906. throw new ArgumentNullException(nameof(selector));
  907. #if CRIPPLED_REFLECTION
  908. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<long>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  909. #else
  910. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  911. #endif
  912. }
  913. public static Task<decimal?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken)
  914. {
  915. if (source == null)
  916. throw new ArgumentNullException(nameof(source));
  917. if (selector == null)
  918. throw new ArgumentNullException(nameof(selector));
  919. #if CRIPPLED_REFLECTION
  920. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  921. #else
  922. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  923. #endif
  924. }
  925. public static Task<decimal> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken)
  926. {
  927. if (source == null)
  928. throw new ArgumentNullException(nameof(source));
  929. if (selector == null)
  930. throw new ArgumentNullException(nameof(selector));
  931. #if CRIPPLED_REFLECTION
  932. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  933. #else
  934. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  935. #endif
  936. }
  937. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken)
  938. {
  939. if (source == null)
  940. throw new ArgumentNullException(nameof(source));
  941. if (selector == null)
  942. throw new ArgumentNullException(nameof(selector));
  943. #if CRIPPLED_REFLECTION
  944. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  945. #else
  946. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  947. #endif
  948. }
  949. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken)
  950. {
  951. if (source == null)
  952. throw new ArgumentNullException(nameof(source));
  953. if (selector == null)
  954. throw new ArgumentNullException(nameof(selector));
  955. #if CRIPPLED_REFLECTION
  956. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  957. #else
  958. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  959. #endif
  960. }
  961. public static Task<float?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken)
  962. {
  963. if (source == null)
  964. throw new ArgumentNullException(nameof(source));
  965. if (selector == null)
  966. throw new ArgumentNullException(nameof(selector));
  967. #if CRIPPLED_REFLECTION
  968. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  969. #else
  970. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  971. #endif
  972. }
  973. public static Task<float> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken)
  974. {
  975. if (source == null)
  976. throw new ArgumentNullException(nameof(source));
  977. if (selector == null)
  978. throw new ArgumentNullException(nameof(selector));
  979. #if CRIPPLED_REFLECTION
  980. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  981. #else
  982. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  983. #endif
  984. }
  985. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken)
  986. {
  987. if (source == null)
  988. throw new ArgumentNullException(nameof(source));
  989. if (selector == null)
  990. throw new ArgumentNullException(nameof(selector));
  991. #if CRIPPLED_REFLECTION
  992. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  993. #else
  994. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  995. #endif
  996. }
  997. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken)
  998. {
  999. if (source == null)
  1000. throw new ArgumentNullException(nameof(source));
  1001. if (selector == null)
  1002. throw new ArgumentNullException(nameof(selector));
  1003. #if CRIPPLED_REFLECTION
  1004. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1005. #else
  1006. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1007. #endif
  1008. }
  1009. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken)
  1010. {
  1011. if (source == null)
  1012. throw new ArgumentNullException(nameof(source));
  1013. if (selector == null)
  1014. throw new ArgumentNullException(nameof(selector));
  1015. #if CRIPPLED_REFLECTION
  1016. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1017. #else
  1018. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1019. #endif
  1020. }
  1021. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken)
  1022. {
  1023. if (source == null)
  1024. throw new ArgumentNullException(nameof(source));
  1025. if (selector == null)
  1026. throw new ArgumentNullException(nameof(selector));
  1027. #if CRIPPLED_REFLECTION
  1028. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1029. #else
  1030. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1031. #endif
  1032. }
  1033. public static Task<decimal?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal?>>> selector, CancellationToken cancellationToken)
  1034. {
  1035. if (source == null)
  1036. throw new ArgumentNullException(nameof(source));
  1037. if (selector == null)
  1038. throw new ArgumentNullException(nameof(selector));
  1039. #if CRIPPLED_REFLECTION
  1040. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1041. #else
  1042. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1043. #endif
  1044. }
  1045. public static Task<decimal> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal>>> selector, CancellationToken cancellationToken)
  1046. {
  1047. if (source == null)
  1048. throw new ArgumentNullException(nameof(source));
  1049. if (selector == null)
  1050. throw new ArgumentNullException(nameof(selector));
  1051. #if CRIPPLED_REFLECTION
  1052. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1053. #else
  1054. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1055. #endif
  1056. }
  1057. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double?>>> selector, CancellationToken cancellationToken)
  1058. {
  1059. if (source == null)
  1060. throw new ArgumentNullException(nameof(source));
  1061. if (selector == null)
  1062. throw new ArgumentNullException(nameof(selector));
  1063. #if CRIPPLED_REFLECTION
  1064. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1065. #else
  1066. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1067. #endif
  1068. }
  1069. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double>>> selector, CancellationToken cancellationToken)
  1070. {
  1071. if (source == null)
  1072. throw new ArgumentNullException(nameof(source));
  1073. if (selector == null)
  1074. throw new ArgumentNullException(nameof(selector));
  1075. #if CRIPPLED_REFLECTION
  1076. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1077. #else
  1078. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1079. #endif
  1080. }
  1081. public static Task<float?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float?>>> selector, CancellationToken cancellationToken)
  1082. {
  1083. if (source == null)
  1084. throw new ArgumentNullException(nameof(source));
  1085. if (selector == null)
  1086. throw new ArgumentNullException(nameof(selector));
  1087. #if CRIPPLED_REFLECTION
  1088. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1089. #else
  1090. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1091. #endif
  1092. }
  1093. public static Task<float> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float>>> selector, CancellationToken cancellationToken)
  1094. {
  1095. if (source == null)
  1096. throw new ArgumentNullException(nameof(source));
  1097. if (selector == null)
  1098. throw new ArgumentNullException(nameof(selector));
  1099. #if CRIPPLED_REFLECTION
  1100. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1101. #else
  1102. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1103. #endif
  1104. }
  1105. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int?>>> selector, CancellationToken cancellationToken)
  1106. {
  1107. if (source == null)
  1108. throw new ArgumentNullException(nameof(source));
  1109. if (selector == null)
  1110. throw new ArgumentNullException(nameof(selector));
  1111. #if CRIPPLED_REFLECTION
  1112. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1113. #else
  1114. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1115. #endif
  1116. }
  1117. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int>>> selector, CancellationToken cancellationToken)
  1118. {
  1119. if (source == null)
  1120. throw new ArgumentNullException(nameof(source));
  1121. if (selector == null)
  1122. throw new ArgumentNullException(nameof(selector));
  1123. #if CRIPPLED_REFLECTION
  1124. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1125. #else
  1126. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1127. #endif
  1128. }
  1129. public static Task<double?> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long?>>> selector, CancellationToken cancellationToken)
  1130. {
  1131. if (source == null)
  1132. throw new ArgumentNullException(nameof(source));
  1133. if (selector == null)
  1134. throw new ArgumentNullException(nameof(selector));
  1135. #if CRIPPLED_REFLECTION
  1136. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1137. #else
  1138. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1139. #endif
  1140. }
  1141. public static Task<double> AverageAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long>>> selector, CancellationToken cancellationToken)
  1142. {
  1143. if (source == null)
  1144. throw new ArgumentNullException(nameof(source));
  1145. if (selector == null)
  1146. throw new ArgumentNullException(nameof(selector));
  1147. #if CRIPPLED_REFLECTION
  1148. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.AverageAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1149. #else
  1150. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1151. #endif
  1152. }
  1153. public static IAsyncQueryable<TResult> Cast<TResult>(this IAsyncQueryable<object> source)
  1154. {
  1155. if (source == null)
  1156. throw new ArgumentNullException(nameof(source));
  1157. #if CRIPPLED_REFLECTION
  1158. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Cast<TResult>(default(IAsyncQueryable<object>))), source.Expression));
  1159. #else
  1160. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), source.Expression));
  1161. #endif
  1162. }
  1163. public static IAsyncQueryable<TSource> Concat<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
  1164. {
  1165. if (first == null)
  1166. throw new ArgumentNullException(nameof(first));
  1167. if (second == null)
  1168. throw new ArgumentNullException(nameof(second));
  1169. #if CRIPPLED_REFLECTION
  1170. return first.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Concat<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>))), first.Expression, GetSourceExpression(second)));
  1171. #else
  1172. return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
  1173. #endif
  1174. }
  1175. public static Task<bool> ContainsAsync<TSource>(this IAsyncQueryable<TSource> source, TSource value)
  1176. {
  1177. if (source == null)
  1178. throw new ArgumentNullException(nameof(source));
  1179. #if CRIPPLED_REFLECTION
  1180. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.ContainsAsync<TSource>(default(IAsyncQueryable<TSource>), default(TSource))), source.Expression, Expression.Constant(value, typeof(TSource))), CancellationToken.None);
  1181. #else
  1182. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource))), CancellationToken.None);
  1183. #endif
  1184. }
  1185. public static Task<bool> ContainsAsync<TSource>(this IAsyncQueryable<TSource> source, TSource value, CancellationToken cancellationToken)
  1186. {
  1187. if (source == null)
  1188. throw new ArgumentNullException(nameof(source));
  1189. #if CRIPPLED_REFLECTION
  1190. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.ContainsAsync<TSource>(default(IAsyncQueryable<TSource>), default(TSource), default(CancellationToken))), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1191. #else
  1192. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1193. #endif
  1194. }
  1195. public static Task<bool> ContainsAsync<TSource>(this IAsyncQueryable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)
  1196. {
  1197. if (source == null)
  1198. throw new ArgumentNullException(nameof(source));
  1199. #if CRIPPLED_REFLECTION
  1200. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.ContainsAsync<TSource>(default(IAsyncQueryable<TSource>), default(TSource), default(IEqualityComparer<TSource>))), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))), CancellationToken.None);
  1201. #else
  1202. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))), CancellationToken.None);
  1203. #endif
  1204. }
  1205. public static Task<bool> ContainsAsync<TSource>(this IAsyncQueryable<TSource> source, TSource value, IEqualityComparer<TSource> comparer, CancellationToken cancellationToken)
  1206. {
  1207. if (source == null)
  1208. throw new ArgumentNullException(nameof(source));
  1209. #if CRIPPLED_REFLECTION
  1210. return source.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.ContainsAsync<TSource>(default(IAsyncQueryable<TSource>), default(TSource), default(IEqualityComparer<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1211. #else
  1212. return source.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(value, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1213. #endif
  1214. }
  1215. public static Task<int> CountAsync<TSource>(this IAsyncQueryable<TSource> source)
  1216. {
  1217. if (source == null)
  1218. throw new ArgumentNullException(nameof(source));
  1219. #if CRIPPLED_REFLECTION
  1220. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.CountAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  1221. #else
  1222. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  1223. #endif
  1224. }
  1225. public static Task<int> CountAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  1226. {
  1227. if (source == null)
  1228. throw new ArgumentNullException(nameof(source));
  1229. #if CRIPPLED_REFLECTION
  1230. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.CountAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1231. #else
  1232. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1233. #endif
  1234. }
  1235. public static Task<int> CountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  1236. {
  1237. if (source == null)
  1238. throw new ArgumentNullException(nameof(source));
  1239. if (predicate == null)
  1240. throw new ArgumentNullException(nameof(predicate));
  1241. #if CRIPPLED_REFLECTION
  1242. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.CountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  1243. #else
  1244. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  1245. #endif
  1246. }
  1247. public static Task<int> CountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  1248. {
  1249. if (source == null)
  1250. throw new ArgumentNullException(nameof(source));
  1251. if (predicate == null)
  1252. throw new ArgumentNullException(nameof(predicate));
  1253. #if CRIPPLED_REFLECTION
  1254. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.CountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  1255. #else
  1256. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  1257. #endif
  1258. }
  1259. public static Task<int> CountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  1260. {
  1261. if (source == null)
  1262. throw new ArgumentNullException(nameof(source));
  1263. if (predicate == null)
  1264. throw new ArgumentNullException(nameof(predicate));
  1265. #if CRIPPLED_REFLECTION
  1266. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.CountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1267. #else
  1268. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1269. #endif
  1270. }
  1271. public static Task<int> CountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  1272. {
  1273. if (source == null)
  1274. throw new ArgumentNullException(nameof(source));
  1275. if (predicate == null)
  1276. throw new ArgumentNullException(nameof(predicate));
  1277. #if CRIPPLED_REFLECTION
  1278. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.CountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1279. #else
  1280. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1281. #endif
  1282. }
  1283. public static Task<int> CountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  1284. {
  1285. if (source == null)
  1286. throw new ArgumentNullException(nameof(source));
  1287. if (predicate == null)
  1288. throw new ArgumentNullException(nameof(predicate));
  1289. #if CRIPPLED_REFLECTION
  1290. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.CountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1291. #else
  1292. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1293. #endif
  1294. }
  1295. public static IAsyncQueryable<TSource> DefaultIfEmpty<TSource>(this IAsyncQueryable<TSource> source)
  1296. {
  1297. if (source == null)
  1298. throw new ArgumentNullException(nameof(source));
  1299. #if CRIPPLED_REFLECTION
  1300. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.DefaultIfEmpty<TSource>(default(IAsyncQueryable<TSource>))), source.Expression));
  1301. #else
  1302. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
  1303. #endif
  1304. }
  1305. public static IAsyncQueryable<TSource> DefaultIfEmpty<TSource>(this IAsyncQueryable<TSource> source, TSource defaultValue)
  1306. {
  1307. if (source == null)
  1308. throw new ArgumentNullException(nameof(source));
  1309. #if CRIPPLED_REFLECTION
  1310. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.DefaultIfEmpty<TSource>(default(IAsyncQueryable<TSource>), default(TSource))), source.Expression, Expression.Constant(defaultValue, typeof(TSource))));
  1311. #else
  1312. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(defaultValue, typeof(TSource))));
  1313. #endif
  1314. }
  1315. public static IAsyncQueryable<TSource> Distinct<TSource>(this IAsyncQueryable<TSource> source)
  1316. {
  1317. if (source == null)
  1318. throw new ArgumentNullException(nameof(source));
  1319. #if CRIPPLED_REFLECTION
  1320. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Distinct<TSource>(default(IAsyncQueryable<TSource>))), source.Expression));
  1321. #else
  1322. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
  1323. #endif
  1324. }
  1325. public static IAsyncQueryable<TSource> Distinct<TSource>(this IAsyncQueryable<TSource> source, IEqualityComparer<TSource> comparer)
  1326. {
  1327. if (source == null)
  1328. throw new ArgumentNullException(nameof(source));
  1329. #if CRIPPLED_REFLECTION
  1330. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Distinct<TSource>(default(IAsyncQueryable<TSource>), default(IEqualityComparer<TSource>))), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  1331. #else
  1332. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  1333. #endif
  1334. }
  1335. public static Task<TSource> ElementAtAsync<TSource>(this IAsyncQueryable<TSource> source, int index)
  1336. {
  1337. if (source == null)
  1338. throw new ArgumentNullException(nameof(source));
  1339. #if CRIPPLED_REFLECTION
  1340. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ElementAtAsync<TSource>(default(IAsyncQueryable<TSource>), default(int))), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None);
  1341. #else
  1342. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None);
  1343. #endif
  1344. }
  1345. public static Task<TSource> ElementAtAsync<TSource>(this IAsyncQueryable<TSource> source, int index, CancellationToken cancellationToken)
  1346. {
  1347. if (source == null)
  1348. throw new ArgumentNullException(nameof(source));
  1349. #if CRIPPLED_REFLECTION
  1350. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ElementAtAsync<TSource>(default(IAsyncQueryable<TSource>), default(int), default(CancellationToken))), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1351. #else
  1352. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1353. #endif
  1354. }
  1355. public static Task<TSource> ElementAtOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, int index)
  1356. {
  1357. if (source == null)
  1358. throw new ArgumentNullException(nameof(source));
  1359. #if CRIPPLED_REFLECTION
  1360. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ElementAtOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(int))), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None);
  1361. #else
  1362. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int))), CancellationToken.None);
  1363. #endif
  1364. }
  1365. public static Task<TSource> ElementAtOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, int index, CancellationToken cancellationToken)
  1366. {
  1367. if (source == null)
  1368. throw new ArgumentNullException(nameof(source));
  1369. #if CRIPPLED_REFLECTION
  1370. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ElementAtOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(int), default(CancellationToken))), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1371. #else
  1372. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(index, typeof(int)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1373. #endif
  1374. }
  1375. public static IAsyncQueryable<TSource> Except<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
  1376. {
  1377. if (first == null)
  1378. throw new ArgumentNullException(nameof(first));
  1379. if (second == null)
  1380. throw new ArgumentNullException(nameof(second));
  1381. #if CRIPPLED_REFLECTION
  1382. return first.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Except<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>))), first.Expression, GetSourceExpression(second)));
  1383. #else
  1384. return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
  1385. #endif
  1386. }
  1387. public static IAsyncQueryable<TSource> Except<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
  1388. {
  1389. if (first == null)
  1390. throw new ArgumentNullException(nameof(first));
  1391. if (second == null)
  1392. throw new ArgumentNullException(nameof(second));
  1393. #if CRIPPLED_REFLECTION
  1394. return first.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Except<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>), default(IEqualityComparer<TSource>))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  1395. #else
  1396. return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  1397. #endif
  1398. }
  1399. public static Task<TSource> FirstAsync<TSource>(this IAsyncQueryable<TSource> source)
  1400. {
  1401. if (source == null)
  1402. throw new ArgumentNullException(nameof(source));
  1403. #if CRIPPLED_REFLECTION
  1404. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  1405. #else
  1406. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  1407. #endif
  1408. }
  1409. public static Task<TSource> FirstAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  1410. {
  1411. if (source == null)
  1412. throw new ArgumentNullException(nameof(source));
  1413. #if CRIPPLED_REFLECTION
  1414. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1415. #else
  1416. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1417. #endif
  1418. }
  1419. public static Task<TSource> FirstAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  1420. {
  1421. if (source == null)
  1422. throw new ArgumentNullException(nameof(source));
  1423. if (predicate == null)
  1424. throw new ArgumentNullException(nameof(predicate));
  1425. #if CRIPPLED_REFLECTION
  1426. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  1427. #else
  1428. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  1429. #endif
  1430. }
  1431. public static Task<TSource> FirstAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  1432. {
  1433. if (source == null)
  1434. throw new ArgumentNullException(nameof(source));
  1435. if (predicate == null)
  1436. throw new ArgumentNullException(nameof(predicate));
  1437. #if CRIPPLED_REFLECTION
  1438. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  1439. #else
  1440. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  1441. #endif
  1442. }
  1443. public static Task<TSource> FirstAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  1444. {
  1445. if (source == null)
  1446. throw new ArgumentNullException(nameof(source));
  1447. if (predicate == null)
  1448. throw new ArgumentNullException(nameof(predicate));
  1449. #if CRIPPLED_REFLECTION
  1450. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1451. #else
  1452. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1453. #endif
  1454. }
  1455. public static Task<TSource> FirstAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  1456. {
  1457. if (source == null)
  1458. throw new ArgumentNullException(nameof(source));
  1459. if (predicate == null)
  1460. throw new ArgumentNullException(nameof(predicate));
  1461. #if CRIPPLED_REFLECTION
  1462. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1463. #else
  1464. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1465. #endif
  1466. }
  1467. public static Task<TSource> FirstAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  1468. {
  1469. if (source == null)
  1470. throw new ArgumentNullException(nameof(source));
  1471. if (predicate == null)
  1472. throw new ArgumentNullException(nameof(predicate));
  1473. #if CRIPPLED_REFLECTION
  1474. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1475. #else
  1476. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1477. #endif
  1478. }
  1479. public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source)
  1480. {
  1481. if (source == null)
  1482. throw new ArgumentNullException(nameof(source));
  1483. #if CRIPPLED_REFLECTION
  1484. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  1485. #else
  1486. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  1487. #endif
  1488. }
  1489. public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  1490. {
  1491. if (source == null)
  1492. throw new ArgumentNullException(nameof(source));
  1493. #if CRIPPLED_REFLECTION
  1494. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1495. #else
  1496. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1497. #endif
  1498. }
  1499. public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  1500. {
  1501. if (source == null)
  1502. throw new ArgumentNullException(nameof(source));
  1503. if (predicate == null)
  1504. throw new ArgumentNullException(nameof(predicate));
  1505. #if CRIPPLED_REFLECTION
  1506. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  1507. #else
  1508. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  1509. #endif
  1510. }
  1511. public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  1512. {
  1513. if (source == null)
  1514. throw new ArgumentNullException(nameof(source));
  1515. if (predicate == null)
  1516. throw new ArgumentNullException(nameof(predicate));
  1517. #if CRIPPLED_REFLECTION
  1518. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  1519. #else
  1520. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  1521. #endif
  1522. }
  1523. public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  1524. {
  1525. if (source == null)
  1526. throw new ArgumentNullException(nameof(source));
  1527. if (predicate == null)
  1528. throw new ArgumentNullException(nameof(predicate));
  1529. #if CRIPPLED_REFLECTION
  1530. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1531. #else
  1532. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1533. #endif
  1534. }
  1535. public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  1536. {
  1537. if (source == null)
  1538. throw new ArgumentNullException(nameof(source));
  1539. if (predicate == null)
  1540. throw new ArgumentNullException(nameof(predicate));
  1541. #if CRIPPLED_REFLECTION
  1542. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1543. #else
  1544. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1545. #endif
  1546. }
  1547. public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  1548. {
  1549. if (source == null)
  1550. throw new ArgumentNullException(nameof(source));
  1551. if (predicate == null)
  1552. throw new ArgumentNullException(nameof(predicate));
  1553. #if CRIPPLED_REFLECTION
  1554. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.FirstOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1555. #else
  1556. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  1557. #endif
  1558. }
  1559. public static IAsyncQueryable<IAsyncGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector)
  1560. {
  1561. if (source == null)
  1562. throw new ArgumentNullException(nameof(source));
  1563. if (keySelector == null)
  1564. throw new ArgumentNullException(nameof(keySelector));
  1565. #if CRIPPLED_REFLECTION
  1566. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>))), source.Expression, keySelector));
  1567. #else
  1568. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  1569. #endif
  1570. }
  1571. public static IAsyncQueryable<IAsyncGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  1572. {
  1573. if (source == null)
  1574. throw new ArgumentNullException(nameof(source));
  1575. if (keySelector == null)
  1576. throw new ArgumentNullException(nameof(keySelector));
  1577. #if CRIPPLED_REFLECTION
  1578. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>))), source.Expression, keySelector));
  1579. #else
  1580. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  1581. #endif
  1582. }
  1583. public static IAsyncQueryable<IAsyncGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector)
  1584. {
  1585. if (source == null)
  1586. throw new ArgumentNullException(nameof(source));
  1587. if (keySelector == null)
  1588. throw new ArgumentNullException(nameof(keySelector));
  1589. #if CRIPPLED_REFLECTION
  1590. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>))), source.Expression, keySelector));
  1591. #else
  1592. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  1593. #endif
  1594. }
  1595. public static IAsyncQueryable<IAsyncGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer)
  1596. {
  1597. if (source == null)
  1598. throw new ArgumentNullException(nameof(source));
  1599. if (keySelector == null)
  1600. throw new ArgumentNullException(nameof(keySelector));
  1601. #if CRIPPLED_REFLECTION
  1602. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1603. #else
  1604. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1605. #endif
  1606. }
  1607. public static IAsyncQueryable<IAsyncGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
  1608. {
  1609. if (source == null)
  1610. throw new ArgumentNullException(nameof(source));
  1611. if (keySelector == null)
  1612. throw new ArgumentNullException(nameof(keySelector));
  1613. #if CRIPPLED_REFLECTION
  1614. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1615. #else
  1616. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1617. #endif
  1618. }
  1619. public static IAsyncQueryable<IAsyncGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer)
  1620. {
  1621. if (source == null)
  1622. throw new ArgumentNullException(nameof(source));
  1623. if (keySelector == null)
  1624. throw new ArgumentNullException(nameof(keySelector));
  1625. #if CRIPPLED_REFLECTION
  1626. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1627. #else
  1628. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1629. #endif
  1630. }
  1631. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TKey, IAsyncEnumerable<TSource>, CancellationToken, ValueTask<TResult>>> resultSelector)
  1632. {
  1633. if (source == null)
  1634. throw new ArgumentNullException(nameof(source));
  1635. if (keySelector == null)
  1636. throw new ArgumentNullException(nameof(keySelector));
  1637. if (resultSelector == null)
  1638. throw new ArgumentNullException(nameof(resultSelector));
  1639. #if CRIPPLED_REFLECTION
  1640. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TKey, IAsyncEnumerable<TSource>, CancellationToken, ValueTask<TResult>>>))), source.Expression, keySelector, resultSelector));
  1641. #else
  1642. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector));
  1643. #endif
  1644. }
  1645. public static IAsyncQueryable<IAsyncGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TSource, CancellationToken, ValueTask<TElement>>> elementSelector)
  1646. {
  1647. if (source == null)
  1648. throw new ArgumentNullException(nameof(source));
  1649. if (keySelector == null)
  1650. throw new ArgumentNullException(nameof(keySelector));
  1651. if (elementSelector == null)
  1652. throw new ArgumentNullException(nameof(elementSelector));
  1653. #if CRIPPLED_REFLECTION
  1654. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TSource, CancellationToken, ValueTask<TElement>>>))), source.Expression, keySelector, elementSelector));
  1655. #else
  1656. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector));
  1657. #endif
  1658. }
  1659. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IAsyncEnumerable<TSource>, TResult>> resultSelector)
  1660. {
  1661. if (source == null)
  1662. throw new ArgumentNullException(nameof(source));
  1663. if (keySelector == null)
  1664. throw new ArgumentNullException(nameof(keySelector));
  1665. if (resultSelector == null)
  1666. throw new ArgumentNullException(nameof(resultSelector));
  1667. #if CRIPPLED_REFLECTION
  1668. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TKey, IAsyncEnumerable<TSource>, TResult>>))), source.Expression, keySelector, resultSelector));
  1669. #else
  1670. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector));
  1671. #endif
  1672. }
  1673. public static IAsyncQueryable<IAsyncGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
  1674. {
  1675. if (source == null)
  1676. throw new ArgumentNullException(nameof(source));
  1677. if (keySelector == null)
  1678. throw new ArgumentNullException(nameof(keySelector));
  1679. if (elementSelector == null)
  1680. throw new ArgumentNullException(nameof(elementSelector));
  1681. #if CRIPPLED_REFLECTION
  1682. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>))), source.Expression, keySelector, elementSelector));
  1683. #else
  1684. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector));
  1685. #endif
  1686. }
  1687. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TKey, IAsyncEnumerable<TSource>, ValueTask<TResult>>> resultSelector)
  1688. {
  1689. if (source == null)
  1690. throw new ArgumentNullException(nameof(source));
  1691. if (keySelector == null)
  1692. throw new ArgumentNullException(nameof(keySelector));
  1693. if (resultSelector == null)
  1694. throw new ArgumentNullException(nameof(resultSelector));
  1695. #if CRIPPLED_REFLECTION
  1696. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TKey, IAsyncEnumerable<TSource>, ValueTask<TResult>>>))), source.Expression, keySelector, resultSelector));
  1697. #else
  1698. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector));
  1699. #endif
  1700. }
  1701. public static IAsyncQueryable<IAsyncGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector)
  1702. {
  1703. if (source == null)
  1704. throw new ArgumentNullException(nameof(source));
  1705. if (keySelector == null)
  1706. throw new ArgumentNullException(nameof(keySelector));
  1707. if (elementSelector == null)
  1708. throw new ArgumentNullException(nameof(elementSelector));
  1709. #if CRIPPLED_REFLECTION
  1710. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>))), source.Expression, keySelector, elementSelector));
  1711. #else
  1712. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector));
  1713. #endif
  1714. }
  1715. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TKey, IAsyncEnumerable<TSource>, CancellationToken, ValueTask<TResult>>> resultSelector, IEqualityComparer<TKey> comparer)
  1716. {
  1717. if (source == null)
  1718. throw new ArgumentNullException(nameof(source));
  1719. if (keySelector == null)
  1720. throw new ArgumentNullException(nameof(keySelector));
  1721. if (resultSelector == null)
  1722. throw new ArgumentNullException(nameof(resultSelector));
  1723. #if CRIPPLED_REFLECTION
  1724. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TKey, IAsyncEnumerable<TSource>, CancellationToken, ValueTask<TResult>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1725. #else
  1726. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1727. #endif
  1728. }
  1729. public static IAsyncQueryable<IAsyncGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TSource, CancellationToken, ValueTask<TElement>>> elementSelector, IEqualityComparer<TKey> comparer)
  1730. {
  1731. if (source == null)
  1732. throw new ArgumentNullException(nameof(source));
  1733. if (keySelector == null)
  1734. throw new ArgumentNullException(nameof(keySelector));
  1735. if (elementSelector == null)
  1736. throw new ArgumentNullException(nameof(elementSelector));
  1737. #if CRIPPLED_REFLECTION
  1738. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TSource, CancellationToken, ValueTask<TElement>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1739. #else
  1740. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1741. #endif
  1742. }
  1743. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TKey, IAsyncEnumerable<TSource>, TResult>> resultSelector, IEqualityComparer<TKey> comparer)
  1744. {
  1745. if (source == null)
  1746. throw new ArgumentNullException(nameof(source));
  1747. if (keySelector == null)
  1748. throw new ArgumentNullException(nameof(keySelector));
  1749. if (resultSelector == null)
  1750. throw new ArgumentNullException(nameof(resultSelector));
  1751. #if CRIPPLED_REFLECTION
  1752. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TKey, IAsyncEnumerable<TSource>, TResult>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1753. #else
  1754. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1755. #endif
  1756. }
  1757. public static IAsyncQueryable<IAsyncGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer)
  1758. {
  1759. if (source == null)
  1760. throw new ArgumentNullException(nameof(source));
  1761. if (keySelector == null)
  1762. throw new ArgumentNullException(nameof(keySelector));
  1763. if (elementSelector == null)
  1764. throw new ArgumentNullException(nameof(elementSelector));
  1765. #if CRIPPLED_REFLECTION
  1766. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1767. #else
  1768. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1769. #endif
  1770. }
  1771. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TKey, IAsyncEnumerable<TSource>, ValueTask<TResult>>> resultSelector, IEqualityComparer<TKey> comparer)
  1772. {
  1773. if (source == null)
  1774. throw new ArgumentNullException(nameof(source));
  1775. if (keySelector == null)
  1776. throw new ArgumentNullException(nameof(keySelector));
  1777. if (resultSelector == null)
  1778. throw new ArgumentNullException(nameof(resultSelector));
  1779. #if CRIPPLED_REFLECTION
  1780. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TKey, IAsyncEnumerable<TSource>, ValueTask<TResult>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1781. #else
  1782. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), source.Expression, keySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1783. #endif
  1784. }
  1785. public static IAsyncQueryable<IAsyncGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, IEqualityComparer<TKey> comparer)
  1786. {
  1787. if (source == null)
  1788. throw new ArgumentNullException(nameof(source));
  1789. if (keySelector == null)
  1790. throw new ArgumentNullException(nameof(keySelector));
  1791. if (elementSelector == null)
  1792. throw new ArgumentNullException(nameof(elementSelector));
  1793. #if CRIPPLED_REFLECTION
  1794. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1795. #else
  1796. return source.Provider.CreateQuery<IAsyncGrouping<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1797. #endif
  1798. }
  1799. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TSource, CancellationToken, ValueTask<TElement>>> elementSelector, Expression<Func<TKey, IAsyncEnumerable<TElement>, CancellationToken, ValueTask<TResult>>> resultSelector)
  1800. {
  1801. if (source == null)
  1802. throw new ArgumentNullException(nameof(source));
  1803. if (keySelector == null)
  1804. throw new ArgumentNullException(nameof(keySelector));
  1805. if (elementSelector == null)
  1806. throw new ArgumentNullException(nameof(elementSelector));
  1807. if (resultSelector == null)
  1808. throw new ArgumentNullException(nameof(resultSelector));
  1809. #if CRIPPLED_REFLECTION
  1810. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TSource, CancellationToken, ValueTask<TElement>>>), default(Expression<Func<TKey, IAsyncEnumerable<TElement>, CancellationToken, ValueTask<TResult>>>))), source.Expression, keySelector, elementSelector, resultSelector));
  1811. #else
  1812. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector));
  1813. #endif
  1814. }
  1815. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IAsyncEnumerable<TElement>, TResult>> resultSelector)
  1816. {
  1817. if (source == null)
  1818. throw new ArgumentNullException(nameof(source));
  1819. if (keySelector == null)
  1820. throw new ArgumentNullException(nameof(keySelector));
  1821. if (elementSelector == null)
  1822. throw new ArgumentNullException(nameof(elementSelector));
  1823. if (resultSelector == null)
  1824. throw new ArgumentNullException(nameof(resultSelector));
  1825. #if CRIPPLED_REFLECTION
  1826. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(Expression<Func<TKey, IAsyncEnumerable<TElement>, TResult>>))), source.Expression, keySelector, elementSelector, resultSelector));
  1827. #else
  1828. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector));
  1829. #endif
  1830. }
  1831. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, Expression<Func<TKey, IAsyncEnumerable<TElement>, ValueTask<TResult>>> resultSelector)
  1832. {
  1833. if (source == null)
  1834. throw new ArgumentNullException(nameof(source));
  1835. if (keySelector == null)
  1836. throw new ArgumentNullException(nameof(keySelector));
  1837. if (elementSelector == null)
  1838. throw new ArgumentNullException(nameof(elementSelector));
  1839. if (resultSelector == null)
  1840. throw new ArgumentNullException(nameof(resultSelector));
  1841. #if CRIPPLED_REFLECTION
  1842. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(Expression<Func<TKey, IAsyncEnumerable<TElement>, ValueTask<TResult>>>))), source.Expression, keySelector, elementSelector, resultSelector));
  1843. #else
  1844. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector));
  1845. #endif
  1846. }
  1847. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TSource, CancellationToken, ValueTask<TElement>>> elementSelector, Expression<Func<TKey, IAsyncEnumerable<TElement>, CancellationToken, ValueTask<TResult>>> resultSelector, IEqualityComparer<TKey> comparer)
  1848. {
  1849. if (source == null)
  1850. throw new ArgumentNullException(nameof(source));
  1851. if (keySelector == null)
  1852. throw new ArgumentNullException(nameof(keySelector));
  1853. if (elementSelector == null)
  1854. throw new ArgumentNullException(nameof(elementSelector));
  1855. if (resultSelector == null)
  1856. throw new ArgumentNullException(nameof(resultSelector));
  1857. #if CRIPPLED_REFLECTION
  1858. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TSource, CancellationToken, ValueTask<TElement>>>), default(Expression<Func<TKey, IAsyncEnumerable<TElement>, CancellationToken, ValueTask<TResult>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1859. #else
  1860. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1861. #endif
  1862. }
  1863. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, Expression<Func<TKey, IAsyncEnumerable<TElement>, TResult>> resultSelector, IEqualityComparer<TKey> comparer)
  1864. {
  1865. if (source == null)
  1866. throw new ArgumentNullException(nameof(source));
  1867. if (keySelector == null)
  1868. throw new ArgumentNullException(nameof(keySelector));
  1869. if (elementSelector == null)
  1870. throw new ArgumentNullException(nameof(elementSelector));
  1871. if (resultSelector == null)
  1872. throw new ArgumentNullException(nameof(resultSelector));
  1873. #if CRIPPLED_REFLECTION
  1874. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(Expression<Func<TKey, IAsyncEnumerable<TElement>, TResult>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1875. #else
  1876. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1877. #endif
  1878. }
  1879. public static IAsyncQueryable<TResult> GroupBy<TSource, TKey, TElement, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, Expression<Func<TKey, IAsyncEnumerable<TElement>, ValueTask<TResult>>> resultSelector, IEqualityComparer<TKey> comparer)
  1880. {
  1881. if (source == null)
  1882. throw new ArgumentNullException(nameof(source));
  1883. if (keySelector == null)
  1884. throw new ArgumentNullException(nameof(keySelector));
  1885. if (elementSelector == null)
  1886. throw new ArgumentNullException(nameof(elementSelector));
  1887. if (resultSelector == null)
  1888. throw new ArgumentNullException(nameof(resultSelector));
  1889. #if CRIPPLED_REFLECTION
  1890. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupBy<TSource, TKey, TElement, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(Expression<Func<TKey, IAsyncEnumerable<TElement>, ValueTask<TResult>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1891. #else
  1892. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), source.Expression, keySelector, elementSelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1893. #endif
  1894. }
  1895. public static IAsyncQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, CancellationToken, ValueTask<TKey>>> outerKeySelector, Expression<Func<TInner, CancellationToken, ValueTask<TKey>>> innerKeySelector, Expression<Func<TOuter, IAsyncEnumerable<TInner>, CancellationToken, ValueTask<TResult>>> resultSelector)
  1896. {
  1897. if (outer == null)
  1898. throw new ArgumentNullException(nameof(outer));
  1899. if (inner == null)
  1900. throw new ArgumentNullException(nameof(inner));
  1901. if (outerKeySelector == null)
  1902. throw new ArgumentNullException(nameof(outerKeySelector));
  1903. if (innerKeySelector == null)
  1904. throw new ArgumentNullException(nameof(innerKeySelector));
  1905. if (resultSelector == null)
  1906. throw new ArgumentNullException(nameof(resultSelector));
  1907. #if CRIPPLED_REFLECTION
  1908. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupJoin<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TInner, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TOuter, IAsyncEnumerable<TInner>, CancellationToken, ValueTask<TResult>>>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  1909. #else
  1910. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  1911. #endif
  1912. }
  1913. public static IAsyncQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IAsyncEnumerable<TInner>, TResult>> resultSelector)
  1914. {
  1915. if (outer == null)
  1916. throw new ArgumentNullException(nameof(outer));
  1917. if (inner == null)
  1918. throw new ArgumentNullException(nameof(inner));
  1919. if (outerKeySelector == null)
  1920. throw new ArgumentNullException(nameof(outerKeySelector));
  1921. if (innerKeySelector == null)
  1922. throw new ArgumentNullException(nameof(innerKeySelector));
  1923. if (resultSelector == null)
  1924. throw new ArgumentNullException(nameof(resultSelector));
  1925. #if CRIPPLED_REFLECTION
  1926. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupJoin<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, TKey>>), default(Expression<Func<TInner, TKey>>), default(Expression<Func<TOuter, IAsyncEnumerable<TInner>, TResult>>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  1927. #else
  1928. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  1929. #endif
  1930. }
  1931. public static IAsyncQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, ValueTask<TKey>>> outerKeySelector, Expression<Func<TInner, ValueTask<TKey>>> innerKeySelector, Expression<Func<TOuter, IAsyncEnumerable<TInner>, ValueTask<TResult>>> resultSelector)
  1932. {
  1933. if (outer == null)
  1934. throw new ArgumentNullException(nameof(outer));
  1935. if (inner == null)
  1936. throw new ArgumentNullException(nameof(inner));
  1937. if (outerKeySelector == null)
  1938. throw new ArgumentNullException(nameof(outerKeySelector));
  1939. if (innerKeySelector == null)
  1940. throw new ArgumentNullException(nameof(innerKeySelector));
  1941. if (resultSelector == null)
  1942. throw new ArgumentNullException(nameof(resultSelector));
  1943. #if CRIPPLED_REFLECTION
  1944. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupJoin<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, ValueTask<TKey>>>), default(Expression<Func<TInner, ValueTask<TKey>>>), default(Expression<Func<TOuter, IAsyncEnumerable<TInner>, ValueTask<TResult>>>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  1945. #else
  1946. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  1947. #endif
  1948. }
  1949. public static IAsyncQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, CancellationToken, ValueTask<TKey>>> outerKeySelector, Expression<Func<TInner, CancellationToken, ValueTask<TKey>>> innerKeySelector, Expression<Func<TOuter, IAsyncEnumerable<TInner>, CancellationToken, ValueTask<TResult>>> resultSelector, IEqualityComparer<TKey> comparer)
  1950. {
  1951. if (outer == null)
  1952. throw new ArgumentNullException(nameof(outer));
  1953. if (inner == null)
  1954. throw new ArgumentNullException(nameof(inner));
  1955. if (outerKeySelector == null)
  1956. throw new ArgumentNullException(nameof(outerKeySelector));
  1957. if (innerKeySelector == null)
  1958. throw new ArgumentNullException(nameof(innerKeySelector));
  1959. if (resultSelector == null)
  1960. throw new ArgumentNullException(nameof(resultSelector));
  1961. #if CRIPPLED_REFLECTION
  1962. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupJoin<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TInner, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TOuter, IAsyncEnumerable<TInner>, CancellationToken, ValueTask<TResult>>>), default(IEqualityComparer<TKey>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1963. #else
  1964. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1965. #endif
  1966. }
  1967. public static IAsyncQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, IAsyncEnumerable<TInner>, TResult>> resultSelector, IEqualityComparer<TKey> comparer)
  1968. {
  1969. if (outer == null)
  1970. throw new ArgumentNullException(nameof(outer));
  1971. if (inner == null)
  1972. throw new ArgumentNullException(nameof(inner));
  1973. if (outerKeySelector == null)
  1974. throw new ArgumentNullException(nameof(outerKeySelector));
  1975. if (innerKeySelector == null)
  1976. throw new ArgumentNullException(nameof(innerKeySelector));
  1977. if (resultSelector == null)
  1978. throw new ArgumentNullException(nameof(resultSelector));
  1979. #if CRIPPLED_REFLECTION
  1980. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupJoin<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, TKey>>), default(Expression<Func<TInner, TKey>>), default(Expression<Func<TOuter, IAsyncEnumerable<TInner>, TResult>>), default(IEqualityComparer<TKey>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1981. #else
  1982. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1983. #endif
  1984. }
  1985. public static IAsyncQueryable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, ValueTask<TKey>>> outerKeySelector, Expression<Func<TInner, ValueTask<TKey>>> innerKeySelector, Expression<Func<TOuter, IAsyncEnumerable<TInner>, ValueTask<TResult>>> resultSelector, IEqualityComparer<TKey> comparer)
  1986. {
  1987. if (outer == null)
  1988. throw new ArgumentNullException(nameof(outer));
  1989. if (inner == null)
  1990. throw new ArgumentNullException(nameof(inner));
  1991. if (outerKeySelector == null)
  1992. throw new ArgumentNullException(nameof(outerKeySelector));
  1993. if (innerKeySelector == null)
  1994. throw new ArgumentNullException(nameof(innerKeySelector));
  1995. if (resultSelector == null)
  1996. throw new ArgumentNullException(nameof(resultSelector));
  1997. #if CRIPPLED_REFLECTION
  1998. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.GroupJoin<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, ValueTask<TKey>>>), default(Expression<Func<TInner, ValueTask<TKey>>>), default(Expression<Func<TOuter, IAsyncEnumerable<TInner>, ValueTask<TResult>>>), default(IEqualityComparer<TKey>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  1999. #else
  2000. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  2001. #endif
  2002. }
  2003. public static IAsyncQueryable<TSource> Intersect<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
  2004. {
  2005. if (first == null)
  2006. throw new ArgumentNullException(nameof(first));
  2007. if (second == null)
  2008. throw new ArgumentNullException(nameof(second));
  2009. #if CRIPPLED_REFLECTION
  2010. return first.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Intersect<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>))), first.Expression, GetSourceExpression(second)));
  2011. #else
  2012. return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
  2013. #endif
  2014. }
  2015. public static IAsyncQueryable<TSource> Intersect<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
  2016. {
  2017. if (first == null)
  2018. throw new ArgumentNullException(nameof(first));
  2019. if (second == null)
  2020. throw new ArgumentNullException(nameof(second));
  2021. #if CRIPPLED_REFLECTION
  2022. return first.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Intersect<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>), default(IEqualityComparer<TSource>))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  2023. #else
  2024. return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  2025. #endif
  2026. }
  2027. public static IAsyncQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, CancellationToken, ValueTask<TKey>>> outerKeySelector, Expression<Func<TInner, CancellationToken, ValueTask<TKey>>> innerKeySelector, Expression<Func<TOuter, TInner, CancellationToken, ValueTask<TResult>>> resultSelector)
  2028. {
  2029. if (outer == null)
  2030. throw new ArgumentNullException(nameof(outer));
  2031. if (inner == null)
  2032. throw new ArgumentNullException(nameof(inner));
  2033. if (outerKeySelector == null)
  2034. throw new ArgumentNullException(nameof(outerKeySelector));
  2035. if (innerKeySelector == null)
  2036. throw new ArgumentNullException(nameof(innerKeySelector));
  2037. if (resultSelector == null)
  2038. throw new ArgumentNullException(nameof(resultSelector));
  2039. #if CRIPPLED_REFLECTION
  2040. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Join<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TInner, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TOuter, TInner, CancellationToken, ValueTask<TResult>>>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  2041. #else
  2042. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  2043. #endif
  2044. }
  2045. public static IAsyncQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector)
  2046. {
  2047. if (outer == null)
  2048. throw new ArgumentNullException(nameof(outer));
  2049. if (inner == null)
  2050. throw new ArgumentNullException(nameof(inner));
  2051. if (outerKeySelector == null)
  2052. throw new ArgumentNullException(nameof(outerKeySelector));
  2053. if (innerKeySelector == null)
  2054. throw new ArgumentNullException(nameof(innerKeySelector));
  2055. if (resultSelector == null)
  2056. throw new ArgumentNullException(nameof(resultSelector));
  2057. #if CRIPPLED_REFLECTION
  2058. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Join<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, TKey>>), default(Expression<Func<TInner, TKey>>), default(Expression<Func<TOuter, TInner, TResult>>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  2059. #else
  2060. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  2061. #endif
  2062. }
  2063. public static IAsyncQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, ValueTask<TKey>>> outerKeySelector, Expression<Func<TInner, ValueTask<TKey>>> innerKeySelector, Expression<Func<TOuter, TInner, ValueTask<TResult>>> resultSelector)
  2064. {
  2065. if (outer == null)
  2066. throw new ArgumentNullException(nameof(outer));
  2067. if (inner == null)
  2068. throw new ArgumentNullException(nameof(inner));
  2069. if (outerKeySelector == null)
  2070. throw new ArgumentNullException(nameof(outerKeySelector));
  2071. if (innerKeySelector == null)
  2072. throw new ArgumentNullException(nameof(innerKeySelector));
  2073. if (resultSelector == null)
  2074. throw new ArgumentNullException(nameof(resultSelector));
  2075. #if CRIPPLED_REFLECTION
  2076. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Join<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, ValueTask<TKey>>>), default(Expression<Func<TInner, ValueTask<TKey>>>), default(Expression<Func<TOuter, TInner, ValueTask<TResult>>>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  2077. #else
  2078. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector));
  2079. #endif
  2080. }
  2081. public static IAsyncQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, CancellationToken, ValueTask<TKey>>> outerKeySelector, Expression<Func<TInner, CancellationToken, ValueTask<TKey>>> innerKeySelector, Expression<Func<TOuter, TInner, CancellationToken, ValueTask<TResult>>> resultSelector, IEqualityComparer<TKey> comparer)
  2082. {
  2083. if (outer == null)
  2084. throw new ArgumentNullException(nameof(outer));
  2085. if (inner == null)
  2086. throw new ArgumentNullException(nameof(inner));
  2087. if (outerKeySelector == null)
  2088. throw new ArgumentNullException(nameof(outerKeySelector));
  2089. if (innerKeySelector == null)
  2090. throw new ArgumentNullException(nameof(innerKeySelector));
  2091. if (resultSelector == null)
  2092. throw new ArgumentNullException(nameof(resultSelector));
  2093. #if CRIPPLED_REFLECTION
  2094. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Join<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TInner, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TOuter, TInner, CancellationToken, ValueTask<TResult>>>), default(IEqualityComparer<TKey>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  2095. #else
  2096. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  2097. #endif
  2098. }
  2099. public static IAsyncQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, TKey>> outerKeySelector, Expression<Func<TInner, TKey>> innerKeySelector, Expression<Func<TOuter, TInner, TResult>> resultSelector, IEqualityComparer<TKey> comparer)
  2100. {
  2101. if (outer == null)
  2102. throw new ArgumentNullException(nameof(outer));
  2103. if (inner == null)
  2104. throw new ArgumentNullException(nameof(inner));
  2105. if (outerKeySelector == null)
  2106. throw new ArgumentNullException(nameof(outerKeySelector));
  2107. if (innerKeySelector == null)
  2108. throw new ArgumentNullException(nameof(innerKeySelector));
  2109. if (resultSelector == null)
  2110. throw new ArgumentNullException(nameof(resultSelector));
  2111. #if CRIPPLED_REFLECTION
  2112. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Join<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, TKey>>), default(Expression<Func<TInner, TKey>>), default(Expression<Func<TOuter, TInner, TResult>>), default(IEqualityComparer<TKey>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  2113. #else
  2114. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  2115. #endif
  2116. }
  2117. public static IAsyncQueryable<TResult> Join<TOuter, TInner, TKey, TResult>(this IAsyncQueryable<TOuter> outer, IAsyncEnumerable<TInner> inner, Expression<Func<TOuter, ValueTask<TKey>>> outerKeySelector, Expression<Func<TInner, ValueTask<TKey>>> innerKeySelector, Expression<Func<TOuter, TInner, ValueTask<TResult>>> resultSelector, IEqualityComparer<TKey> comparer)
  2118. {
  2119. if (outer == null)
  2120. throw new ArgumentNullException(nameof(outer));
  2121. if (inner == null)
  2122. throw new ArgumentNullException(nameof(inner));
  2123. if (outerKeySelector == null)
  2124. throw new ArgumentNullException(nameof(outerKeySelector));
  2125. if (innerKeySelector == null)
  2126. throw new ArgumentNullException(nameof(innerKeySelector));
  2127. if (resultSelector == null)
  2128. throw new ArgumentNullException(nameof(resultSelector));
  2129. #if CRIPPLED_REFLECTION
  2130. return outer.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Join<TOuter, TInner, TKey, TResult>(default(IAsyncQueryable<TOuter>), default(IAsyncEnumerable<TInner>), default(Expression<Func<TOuter, ValueTask<TKey>>>), default(Expression<Func<TInner, ValueTask<TKey>>>), default(Expression<Func<TOuter, TInner, ValueTask<TResult>>>), default(IEqualityComparer<TKey>))), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  2131. #else
  2132. return outer.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), outer.Expression, GetSourceExpression(inner), outerKeySelector, innerKeySelector, resultSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))));
  2133. #endif
  2134. }
  2135. public static Task<TSource> LastAsync<TSource>(this IAsyncQueryable<TSource> source)
  2136. {
  2137. if (source == null)
  2138. throw new ArgumentNullException(nameof(source));
  2139. #if CRIPPLED_REFLECTION
  2140. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  2141. #else
  2142. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  2143. #endif
  2144. }
  2145. public static Task<TSource> LastAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  2146. {
  2147. if (source == null)
  2148. throw new ArgumentNullException(nameof(source));
  2149. #if CRIPPLED_REFLECTION
  2150. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2151. #else
  2152. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2153. #endif
  2154. }
  2155. public static Task<TSource> LastAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  2156. {
  2157. if (source == null)
  2158. throw new ArgumentNullException(nameof(source));
  2159. if (predicate == null)
  2160. throw new ArgumentNullException(nameof(predicate));
  2161. #if CRIPPLED_REFLECTION
  2162. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  2163. #else
  2164. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  2165. #endif
  2166. }
  2167. public static Task<TSource> LastAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  2168. {
  2169. if (source == null)
  2170. throw new ArgumentNullException(nameof(source));
  2171. if (predicate == null)
  2172. throw new ArgumentNullException(nameof(predicate));
  2173. #if CRIPPLED_REFLECTION
  2174. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  2175. #else
  2176. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  2177. #endif
  2178. }
  2179. public static Task<TSource> LastAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  2180. {
  2181. if (source == null)
  2182. throw new ArgumentNullException(nameof(source));
  2183. if (predicate == null)
  2184. throw new ArgumentNullException(nameof(predicate));
  2185. #if CRIPPLED_REFLECTION
  2186. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2187. #else
  2188. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2189. #endif
  2190. }
  2191. public static Task<TSource> LastAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  2192. {
  2193. if (source == null)
  2194. throw new ArgumentNullException(nameof(source));
  2195. if (predicate == null)
  2196. throw new ArgumentNullException(nameof(predicate));
  2197. #if CRIPPLED_REFLECTION
  2198. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2199. #else
  2200. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2201. #endif
  2202. }
  2203. public static Task<TSource> LastAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  2204. {
  2205. if (source == null)
  2206. throw new ArgumentNullException(nameof(source));
  2207. if (predicate == null)
  2208. throw new ArgumentNullException(nameof(predicate));
  2209. #if CRIPPLED_REFLECTION
  2210. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2211. #else
  2212. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2213. #endif
  2214. }
  2215. public static Task<TSource> LastOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source)
  2216. {
  2217. if (source == null)
  2218. throw new ArgumentNullException(nameof(source));
  2219. #if CRIPPLED_REFLECTION
  2220. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  2221. #else
  2222. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  2223. #endif
  2224. }
  2225. public static Task<TSource> LastOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  2226. {
  2227. if (source == null)
  2228. throw new ArgumentNullException(nameof(source));
  2229. #if CRIPPLED_REFLECTION
  2230. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2231. #else
  2232. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2233. #endif
  2234. }
  2235. public static Task<TSource> LastOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  2236. {
  2237. if (source == null)
  2238. throw new ArgumentNullException(nameof(source));
  2239. if (predicate == null)
  2240. throw new ArgumentNullException(nameof(predicate));
  2241. #if CRIPPLED_REFLECTION
  2242. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  2243. #else
  2244. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  2245. #endif
  2246. }
  2247. public static Task<TSource> LastOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  2248. {
  2249. if (source == null)
  2250. throw new ArgumentNullException(nameof(source));
  2251. if (predicate == null)
  2252. throw new ArgumentNullException(nameof(predicate));
  2253. #if CRIPPLED_REFLECTION
  2254. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  2255. #else
  2256. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  2257. #endif
  2258. }
  2259. public static Task<TSource> LastOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  2260. {
  2261. if (source == null)
  2262. throw new ArgumentNullException(nameof(source));
  2263. if (predicate == null)
  2264. throw new ArgumentNullException(nameof(predicate));
  2265. #if CRIPPLED_REFLECTION
  2266. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2267. #else
  2268. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2269. #endif
  2270. }
  2271. public static Task<TSource> LastOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  2272. {
  2273. if (source == null)
  2274. throw new ArgumentNullException(nameof(source));
  2275. if (predicate == null)
  2276. throw new ArgumentNullException(nameof(predicate));
  2277. #if CRIPPLED_REFLECTION
  2278. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2279. #else
  2280. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2281. #endif
  2282. }
  2283. public static Task<TSource> LastOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  2284. {
  2285. if (source == null)
  2286. throw new ArgumentNullException(nameof(source));
  2287. if (predicate == null)
  2288. throw new ArgumentNullException(nameof(predicate));
  2289. #if CRIPPLED_REFLECTION
  2290. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.LastOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2291. #else
  2292. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2293. #endif
  2294. }
  2295. public static Task<long> LongCountAsync<TSource>(this IAsyncQueryable<TSource> source)
  2296. {
  2297. if (source == null)
  2298. throw new ArgumentNullException(nameof(source));
  2299. #if CRIPPLED_REFLECTION
  2300. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.LongCountAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  2301. #else
  2302. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  2303. #endif
  2304. }
  2305. public static Task<long> LongCountAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  2306. {
  2307. if (source == null)
  2308. throw new ArgumentNullException(nameof(source));
  2309. #if CRIPPLED_REFLECTION
  2310. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.LongCountAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2311. #else
  2312. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2313. #endif
  2314. }
  2315. public static Task<long> LongCountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  2316. {
  2317. if (source == null)
  2318. throw new ArgumentNullException(nameof(source));
  2319. if (predicate == null)
  2320. throw new ArgumentNullException(nameof(predicate));
  2321. #if CRIPPLED_REFLECTION
  2322. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.LongCountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  2323. #else
  2324. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  2325. #endif
  2326. }
  2327. public static Task<long> LongCountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  2328. {
  2329. if (source == null)
  2330. throw new ArgumentNullException(nameof(source));
  2331. if (predicate == null)
  2332. throw new ArgumentNullException(nameof(predicate));
  2333. #if CRIPPLED_REFLECTION
  2334. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.LongCountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  2335. #else
  2336. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  2337. #endif
  2338. }
  2339. public static Task<long> LongCountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  2340. {
  2341. if (source == null)
  2342. throw new ArgumentNullException(nameof(source));
  2343. if (predicate == null)
  2344. throw new ArgumentNullException(nameof(predicate));
  2345. #if CRIPPLED_REFLECTION
  2346. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.LongCountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2347. #else
  2348. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2349. #endif
  2350. }
  2351. public static Task<long> LongCountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  2352. {
  2353. if (source == null)
  2354. throw new ArgumentNullException(nameof(source));
  2355. if (predicate == null)
  2356. throw new ArgumentNullException(nameof(predicate));
  2357. #if CRIPPLED_REFLECTION
  2358. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.LongCountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2359. #else
  2360. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2361. #endif
  2362. }
  2363. public static Task<long> LongCountAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  2364. {
  2365. if (source == null)
  2366. throw new ArgumentNullException(nameof(source));
  2367. if (predicate == null)
  2368. throw new ArgumentNullException(nameof(predicate));
  2369. #if CRIPPLED_REFLECTION
  2370. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.LongCountAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2371. #else
  2372. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2373. #endif
  2374. }
  2375. public static Task<decimal?> MaxAsync(this IAsyncQueryable<decimal?> source)
  2376. {
  2377. if (source == null)
  2378. throw new ArgumentNullException(nameof(source));
  2379. #if CRIPPLED_REFLECTION
  2380. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<decimal?>))), source.Expression), CancellationToken.None);
  2381. #else
  2382. return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2383. #endif
  2384. }
  2385. public static Task<decimal> MaxAsync(this IAsyncQueryable<decimal> source)
  2386. {
  2387. if (source == null)
  2388. throw new ArgumentNullException(nameof(source));
  2389. #if CRIPPLED_REFLECTION
  2390. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<decimal>))), source.Expression), CancellationToken.None);
  2391. #else
  2392. return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2393. #endif
  2394. }
  2395. public static Task<double?> MaxAsync(this IAsyncQueryable<double?> source)
  2396. {
  2397. if (source == null)
  2398. throw new ArgumentNullException(nameof(source));
  2399. #if CRIPPLED_REFLECTION
  2400. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<double?>))), source.Expression), CancellationToken.None);
  2401. #else
  2402. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2403. #endif
  2404. }
  2405. public static Task<double> MaxAsync(this IAsyncQueryable<double> source)
  2406. {
  2407. if (source == null)
  2408. throw new ArgumentNullException(nameof(source));
  2409. #if CRIPPLED_REFLECTION
  2410. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<double>))), source.Expression), CancellationToken.None);
  2411. #else
  2412. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2413. #endif
  2414. }
  2415. public static Task<float?> MaxAsync(this IAsyncQueryable<float?> source)
  2416. {
  2417. if (source == null)
  2418. throw new ArgumentNullException(nameof(source));
  2419. #if CRIPPLED_REFLECTION
  2420. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<float?>))), source.Expression), CancellationToken.None);
  2421. #else
  2422. return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2423. #endif
  2424. }
  2425. public static Task<float> MaxAsync(this IAsyncQueryable<float> source)
  2426. {
  2427. if (source == null)
  2428. throw new ArgumentNullException(nameof(source));
  2429. #if CRIPPLED_REFLECTION
  2430. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<float>))), source.Expression), CancellationToken.None);
  2431. #else
  2432. return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2433. #endif
  2434. }
  2435. public static Task<int?> MaxAsync(this IAsyncQueryable<int?> source)
  2436. {
  2437. if (source == null)
  2438. throw new ArgumentNullException(nameof(source));
  2439. #if CRIPPLED_REFLECTION
  2440. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<int?>))), source.Expression), CancellationToken.None);
  2441. #else
  2442. return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2443. #endif
  2444. }
  2445. public static Task<int> MaxAsync(this IAsyncQueryable<int> source)
  2446. {
  2447. if (source == null)
  2448. throw new ArgumentNullException(nameof(source));
  2449. #if CRIPPLED_REFLECTION
  2450. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<int>))), source.Expression), CancellationToken.None);
  2451. #else
  2452. return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2453. #endif
  2454. }
  2455. public static Task<long?> MaxAsync(this IAsyncQueryable<long?> source)
  2456. {
  2457. if (source == null)
  2458. throw new ArgumentNullException(nameof(source));
  2459. #if CRIPPLED_REFLECTION
  2460. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<long?>))), source.Expression), CancellationToken.None);
  2461. #else
  2462. return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2463. #endif
  2464. }
  2465. public static Task<long> MaxAsync(this IAsyncQueryable<long> source)
  2466. {
  2467. if (source == null)
  2468. throw new ArgumentNullException(nameof(source));
  2469. #if CRIPPLED_REFLECTION
  2470. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<long>))), source.Expression), CancellationToken.None);
  2471. #else
  2472. return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  2473. #endif
  2474. }
  2475. public static Task<decimal?> MaxAsync(this IAsyncQueryable<decimal?> source, CancellationToken cancellationToken)
  2476. {
  2477. if (source == null)
  2478. throw new ArgumentNullException(nameof(source));
  2479. #if CRIPPLED_REFLECTION
  2480. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<decimal?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2481. #else
  2482. return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2483. #endif
  2484. }
  2485. public static Task<decimal> MaxAsync(this IAsyncQueryable<decimal> source, CancellationToken cancellationToken)
  2486. {
  2487. if (source == null)
  2488. throw new ArgumentNullException(nameof(source));
  2489. #if CRIPPLED_REFLECTION
  2490. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<decimal>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2491. #else
  2492. return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2493. #endif
  2494. }
  2495. public static Task<double?> MaxAsync(this IAsyncQueryable<double?> source, CancellationToken cancellationToken)
  2496. {
  2497. if (source == null)
  2498. throw new ArgumentNullException(nameof(source));
  2499. #if CRIPPLED_REFLECTION
  2500. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<double?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2501. #else
  2502. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2503. #endif
  2504. }
  2505. public static Task<double> MaxAsync(this IAsyncQueryable<double> source, CancellationToken cancellationToken)
  2506. {
  2507. if (source == null)
  2508. throw new ArgumentNullException(nameof(source));
  2509. #if CRIPPLED_REFLECTION
  2510. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<double>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2511. #else
  2512. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2513. #endif
  2514. }
  2515. public static Task<float?> MaxAsync(this IAsyncQueryable<float?> source, CancellationToken cancellationToken)
  2516. {
  2517. if (source == null)
  2518. throw new ArgumentNullException(nameof(source));
  2519. #if CRIPPLED_REFLECTION
  2520. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<float?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2521. #else
  2522. return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2523. #endif
  2524. }
  2525. public static Task<float> MaxAsync(this IAsyncQueryable<float> source, CancellationToken cancellationToken)
  2526. {
  2527. if (source == null)
  2528. throw new ArgumentNullException(nameof(source));
  2529. #if CRIPPLED_REFLECTION
  2530. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<float>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2531. #else
  2532. return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2533. #endif
  2534. }
  2535. public static Task<int?> MaxAsync(this IAsyncQueryable<int?> source, CancellationToken cancellationToken)
  2536. {
  2537. if (source == null)
  2538. throw new ArgumentNullException(nameof(source));
  2539. #if CRIPPLED_REFLECTION
  2540. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<int?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2541. #else
  2542. return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2543. #endif
  2544. }
  2545. public static Task<int> MaxAsync(this IAsyncQueryable<int> source, CancellationToken cancellationToken)
  2546. {
  2547. if (source == null)
  2548. throw new ArgumentNullException(nameof(source));
  2549. #if CRIPPLED_REFLECTION
  2550. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<int>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2551. #else
  2552. return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2553. #endif
  2554. }
  2555. public static Task<long?> MaxAsync(this IAsyncQueryable<long?> source, CancellationToken cancellationToken)
  2556. {
  2557. if (source == null)
  2558. throw new ArgumentNullException(nameof(source));
  2559. #if CRIPPLED_REFLECTION
  2560. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<long?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2561. #else
  2562. return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2563. #endif
  2564. }
  2565. public static Task<long> MaxAsync(this IAsyncQueryable<long> source, CancellationToken cancellationToken)
  2566. {
  2567. if (source == null)
  2568. throw new ArgumentNullException(nameof(source));
  2569. #if CRIPPLED_REFLECTION
  2570. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync(default(IAsyncQueryable<long>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2571. #else
  2572. return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2573. #endif
  2574. }
  2575. public static Task<TSource> MaxAsync<TSource>(this IAsyncQueryable<TSource> source)
  2576. {
  2577. if (source == null)
  2578. throw new ArgumentNullException(nameof(source));
  2579. #if CRIPPLED_REFLECTION
  2580. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  2581. #else
  2582. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  2583. #endif
  2584. }
  2585. public static Task<TSource> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  2586. {
  2587. if (source == null)
  2588. throw new ArgumentNullException(nameof(source));
  2589. #if CRIPPLED_REFLECTION
  2590. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2591. #else
  2592. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2593. #endif
  2594. }
  2595. public static Task<decimal?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
  2596. {
  2597. if (source == null)
  2598. throw new ArgumentNullException(nameof(source));
  2599. if (selector == null)
  2600. throw new ArgumentNullException(nameof(selector));
  2601. #if CRIPPLED_REFLECTION
  2602. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal?>>))), source.Expression, selector), CancellationToken.None);
  2603. #else
  2604. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2605. #endif
  2606. }
  2607. public static Task<decimal> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
  2608. {
  2609. if (source == null)
  2610. throw new ArgumentNullException(nameof(source));
  2611. if (selector == null)
  2612. throw new ArgumentNullException(nameof(selector));
  2613. #if CRIPPLED_REFLECTION
  2614. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal>>))), source.Expression, selector), CancellationToken.None);
  2615. #else
  2616. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2617. #endif
  2618. }
  2619. public static Task<double?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
  2620. {
  2621. if (source == null)
  2622. throw new ArgumentNullException(nameof(source));
  2623. if (selector == null)
  2624. throw new ArgumentNullException(nameof(selector));
  2625. #if CRIPPLED_REFLECTION
  2626. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double?>>))), source.Expression, selector), CancellationToken.None);
  2627. #else
  2628. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2629. #endif
  2630. }
  2631. public static Task<double> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector)
  2632. {
  2633. if (source == null)
  2634. throw new ArgumentNullException(nameof(source));
  2635. if (selector == null)
  2636. throw new ArgumentNullException(nameof(selector));
  2637. #if CRIPPLED_REFLECTION
  2638. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double>>))), source.Expression, selector), CancellationToken.None);
  2639. #else
  2640. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2641. #endif
  2642. }
  2643. public static Task<float?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
  2644. {
  2645. if (source == null)
  2646. throw new ArgumentNullException(nameof(source));
  2647. if (selector == null)
  2648. throw new ArgumentNullException(nameof(selector));
  2649. #if CRIPPLED_REFLECTION
  2650. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float?>>))), source.Expression, selector), CancellationToken.None);
  2651. #else
  2652. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2653. #endif
  2654. }
  2655. public static Task<float> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector)
  2656. {
  2657. if (source == null)
  2658. throw new ArgumentNullException(nameof(source));
  2659. if (selector == null)
  2660. throw new ArgumentNullException(nameof(selector));
  2661. #if CRIPPLED_REFLECTION
  2662. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float>>))), source.Expression, selector), CancellationToken.None);
  2663. #else
  2664. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2665. #endif
  2666. }
  2667. public static Task<int?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
  2668. {
  2669. if (source == null)
  2670. throw new ArgumentNullException(nameof(source));
  2671. if (selector == null)
  2672. throw new ArgumentNullException(nameof(selector));
  2673. #if CRIPPLED_REFLECTION
  2674. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int?>>))), source.Expression, selector), CancellationToken.None);
  2675. #else
  2676. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2677. #endif
  2678. }
  2679. public static Task<int> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector)
  2680. {
  2681. if (source == null)
  2682. throw new ArgumentNullException(nameof(source));
  2683. if (selector == null)
  2684. throw new ArgumentNullException(nameof(selector));
  2685. #if CRIPPLED_REFLECTION
  2686. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int>>))), source.Expression, selector), CancellationToken.None);
  2687. #else
  2688. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2689. #endif
  2690. }
  2691. public static Task<long?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
  2692. {
  2693. if (source == null)
  2694. throw new ArgumentNullException(nameof(source));
  2695. if (selector == null)
  2696. throw new ArgumentNullException(nameof(selector));
  2697. #if CRIPPLED_REFLECTION
  2698. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long?>>))), source.Expression, selector), CancellationToken.None);
  2699. #else
  2700. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2701. #endif
  2702. }
  2703. public static Task<long> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector)
  2704. {
  2705. if (source == null)
  2706. throw new ArgumentNullException(nameof(source));
  2707. if (selector == null)
  2708. throw new ArgumentNullException(nameof(selector));
  2709. #if CRIPPLED_REFLECTION
  2710. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long>>))), source.Expression, selector), CancellationToken.None);
  2711. #else
  2712. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2713. #endif
  2714. }
  2715. public static Task<decimal?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal?>>> selector)
  2716. {
  2717. if (source == null)
  2718. throw new ArgumentNullException(nameof(source));
  2719. if (selector == null)
  2720. throw new ArgumentNullException(nameof(selector));
  2721. #if CRIPPLED_REFLECTION
  2722. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal?>>>))), source.Expression, selector), CancellationToken.None);
  2723. #else
  2724. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2725. #endif
  2726. }
  2727. public static Task<decimal> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal>>> selector)
  2728. {
  2729. if (source == null)
  2730. throw new ArgumentNullException(nameof(source));
  2731. if (selector == null)
  2732. throw new ArgumentNullException(nameof(selector));
  2733. #if CRIPPLED_REFLECTION
  2734. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal>>>))), source.Expression, selector), CancellationToken.None);
  2735. #else
  2736. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2737. #endif
  2738. }
  2739. public static Task<double?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double?>>> selector)
  2740. {
  2741. if (source == null)
  2742. throw new ArgumentNullException(nameof(source));
  2743. if (selector == null)
  2744. throw new ArgumentNullException(nameof(selector));
  2745. #if CRIPPLED_REFLECTION
  2746. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double?>>>))), source.Expression, selector), CancellationToken.None);
  2747. #else
  2748. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2749. #endif
  2750. }
  2751. public static Task<double> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double>>> selector)
  2752. {
  2753. if (source == null)
  2754. throw new ArgumentNullException(nameof(source));
  2755. if (selector == null)
  2756. throw new ArgumentNullException(nameof(selector));
  2757. #if CRIPPLED_REFLECTION
  2758. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double>>>))), source.Expression, selector), CancellationToken.None);
  2759. #else
  2760. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2761. #endif
  2762. }
  2763. public static Task<float?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float?>>> selector)
  2764. {
  2765. if (source == null)
  2766. throw new ArgumentNullException(nameof(source));
  2767. if (selector == null)
  2768. throw new ArgumentNullException(nameof(selector));
  2769. #if CRIPPLED_REFLECTION
  2770. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float?>>>))), source.Expression, selector), CancellationToken.None);
  2771. #else
  2772. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2773. #endif
  2774. }
  2775. public static Task<float> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float>>> selector)
  2776. {
  2777. if (source == null)
  2778. throw new ArgumentNullException(nameof(source));
  2779. if (selector == null)
  2780. throw new ArgumentNullException(nameof(selector));
  2781. #if CRIPPLED_REFLECTION
  2782. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float>>>))), source.Expression, selector), CancellationToken.None);
  2783. #else
  2784. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2785. #endif
  2786. }
  2787. public static Task<int?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int?>>> selector)
  2788. {
  2789. if (source == null)
  2790. throw new ArgumentNullException(nameof(source));
  2791. if (selector == null)
  2792. throw new ArgumentNullException(nameof(selector));
  2793. #if CRIPPLED_REFLECTION
  2794. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int?>>>))), source.Expression, selector), CancellationToken.None);
  2795. #else
  2796. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2797. #endif
  2798. }
  2799. public static Task<int> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int>>> selector)
  2800. {
  2801. if (source == null)
  2802. throw new ArgumentNullException(nameof(source));
  2803. if (selector == null)
  2804. throw new ArgumentNullException(nameof(selector));
  2805. #if CRIPPLED_REFLECTION
  2806. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int>>>))), source.Expression, selector), CancellationToken.None);
  2807. #else
  2808. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2809. #endif
  2810. }
  2811. public static Task<long?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long?>>> selector)
  2812. {
  2813. if (source == null)
  2814. throw new ArgumentNullException(nameof(source));
  2815. if (selector == null)
  2816. throw new ArgumentNullException(nameof(selector));
  2817. #if CRIPPLED_REFLECTION
  2818. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long?>>>))), source.Expression, selector), CancellationToken.None);
  2819. #else
  2820. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2821. #endif
  2822. }
  2823. public static Task<long> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long>>> selector)
  2824. {
  2825. if (source == null)
  2826. throw new ArgumentNullException(nameof(source));
  2827. if (selector == null)
  2828. throw new ArgumentNullException(nameof(selector));
  2829. #if CRIPPLED_REFLECTION
  2830. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long>>>))), source.Expression, selector), CancellationToken.None);
  2831. #else
  2832. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  2833. #endif
  2834. }
  2835. public static Task<decimal?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<decimal?>>> selector, CancellationToken cancellationToken)
  2836. {
  2837. if (source == null)
  2838. throw new ArgumentNullException(nameof(source));
  2839. if (selector == null)
  2840. throw new ArgumentNullException(nameof(selector));
  2841. #if CRIPPLED_REFLECTION
  2842. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<decimal?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2843. #else
  2844. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2845. #endif
  2846. }
  2847. public static Task<decimal> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<decimal>>> selector, CancellationToken cancellationToken)
  2848. {
  2849. if (source == null)
  2850. throw new ArgumentNullException(nameof(source));
  2851. if (selector == null)
  2852. throw new ArgumentNullException(nameof(selector));
  2853. #if CRIPPLED_REFLECTION
  2854. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<decimal>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2855. #else
  2856. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2857. #endif
  2858. }
  2859. public static Task<double?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<double?>>> selector, CancellationToken cancellationToken)
  2860. {
  2861. if (source == null)
  2862. throw new ArgumentNullException(nameof(source));
  2863. if (selector == null)
  2864. throw new ArgumentNullException(nameof(selector));
  2865. #if CRIPPLED_REFLECTION
  2866. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<double?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2867. #else
  2868. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2869. #endif
  2870. }
  2871. public static Task<double> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<double>>> selector, CancellationToken cancellationToken)
  2872. {
  2873. if (source == null)
  2874. throw new ArgumentNullException(nameof(source));
  2875. if (selector == null)
  2876. throw new ArgumentNullException(nameof(selector));
  2877. #if CRIPPLED_REFLECTION
  2878. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<double>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2879. #else
  2880. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2881. #endif
  2882. }
  2883. public static Task<float?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<float?>>> selector, CancellationToken cancellationToken)
  2884. {
  2885. if (source == null)
  2886. throw new ArgumentNullException(nameof(source));
  2887. if (selector == null)
  2888. throw new ArgumentNullException(nameof(selector));
  2889. #if CRIPPLED_REFLECTION
  2890. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<float?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2891. #else
  2892. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2893. #endif
  2894. }
  2895. public static Task<float> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<float>>> selector, CancellationToken cancellationToken)
  2896. {
  2897. if (source == null)
  2898. throw new ArgumentNullException(nameof(source));
  2899. if (selector == null)
  2900. throw new ArgumentNullException(nameof(selector));
  2901. #if CRIPPLED_REFLECTION
  2902. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<float>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2903. #else
  2904. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2905. #endif
  2906. }
  2907. public static Task<int?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<int?>>> selector, CancellationToken cancellationToken)
  2908. {
  2909. if (source == null)
  2910. throw new ArgumentNullException(nameof(source));
  2911. if (selector == null)
  2912. throw new ArgumentNullException(nameof(selector));
  2913. #if CRIPPLED_REFLECTION
  2914. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<int?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2915. #else
  2916. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2917. #endif
  2918. }
  2919. public static Task<int> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<int>>> selector, CancellationToken cancellationToken)
  2920. {
  2921. if (source == null)
  2922. throw new ArgumentNullException(nameof(source));
  2923. if (selector == null)
  2924. throw new ArgumentNullException(nameof(selector));
  2925. #if CRIPPLED_REFLECTION
  2926. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<int>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2927. #else
  2928. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2929. #endif
  2930. }
  2931. public static Task<long?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<long?>>> selector, CancellationToken cancellationToken)
  2932. {
  2933. if (source == null)
  2934. throw new ArgumentNullException(nameof(source));
  2935. if (selector == null)
  2936. throw new ArgumentNullException(nameof(selector));
  2937. #if CRIPPLED_REFLECTION
  2938. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<long?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2939. #else
  2940. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2941. #endif
  2942. }
  2943. public static Task<long> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<long>>> selector, CancellationToken cancellationToken)
  2944. {
  2945. if (source == null)
  2946. throw new ArgumentNullException(nameof(source));
  2947. if (selector == null)
  2948. throw new ArgumentNullException(nameof(selector));
  2949. #if CRIPPLED_REFLECTION
  2950. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<long>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2951. #else
  2952. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2953. #endif
  2954. }
  2955. public static Task<decimal?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken)
  2956. {
  2957. if (source == null)
  2958. throw new ArgumentNullException(nameof(source));
  2959. if (selector == null)
  2960. throw new ArgumentNullException(nameof(selector));
  2961. #if CRIPPLED_REFLECTION
  2962. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2963. #else
  2964. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2965. #endif
  2966. }
  2967. public static Task<decimal> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken)
  2968. {
  2969. if (source == null)
  2970. throw new ArgumentNullException(nameof(source));
  2971. if (selector == null)
  2972. throw new ArgumentNullException(nameof(selector));
  2973. #if CRIPPLED_REFLECTION
  2974. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2975. #else
  2976. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2977. #endif
  2978. }
  2979. public static Task<double?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken)
  2980. {
  2981. if (source == null)
  2982. throw new ArgumentNullException(nameof(source));
  2983. if (selector == null)
  2984. throw new ArgumentNullException(nameof(selector));
  2985. #if CRIPPLED_REFLECTION
  2986. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2987. #else
  2988. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2989. #endif
  2990. }
  2991. public static Task<double> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken)
  2992. {
  2993. if (source == null)
  2994. throw new ArgumentNullException(nameof(source));
  2995. if (selector == null)
  2996. throw new ArgumentNullException(nameof(selector));
  2997. #if CRIPPLED_REFLECTION
  2998. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  2999. #else
  3000. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3001. #endif
  3002. }
  3003. public static Task<float?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken)
  3004. {
  3005. if (source == null)
  3006. throw new ArgumentNullException(nameof(source));
  3007. if (selector == null)
  3008. throw new ArgumentNullException(nameof(selector));
  3009. #if CRIPPLED_REFLECTION
  3010. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3011. #else
  3012. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3013. #endif
  3014. }
  3015. public static Task<float> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken)
  3016. {
  3017. if (source == null)
  3018. throw new ArgumentNullException(nameof(source));
  3019. if (selector == null)
  3020. throw new ArgumentNullException(nameof(selector));
  3021. #if CRIPPLED_REFLECTION
  3022. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3023. #else
  3024. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3025. #endif
  3026. }
  3027. public static Task<int?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken)
  3028. {
  3029. if (source == null)
  3030. throw new ArgumentNullException(nameof(source));
  3031. if (selector == null)
  3032. throw new ArgumentNullException(nameof(selector));
  3033. #if CRIPPLED_REFLECTION
  3034. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3035. #else
  3036. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3037. #endif
  3038. }
  3039. public static Task<int> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken)
  3040. {
  3041. if (source == null)
  3042. throw new ArgumentNullException(nameof(source));
  3043. if (selector == null)
  3044. throw new ArgumentNullException(nameof(selector));
  3045. #if CRIPPLED_REFLECTION
  3046. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3047. #else
  3048. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3049. #endif
  3050. }
  3051. public static Task<long?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken)
  3052. {
  3053. if (source == null)
  3054. throw new ArgumentNullException(nameof(source));
  3055. if (selector == null)
  3056. throw new ArgumentNullException(nameof(selector));
  3057. #if CRIPPLED_REFLECTION
  3058. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3059. #else
  3060. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3061. #endif
  3062. }
  3063. public static Task<long> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken)
  3064. {
  3065. if (source == null)
  3066. throw new ArgumentNullException(nameof(source));
  3067. if (selector == null)
  3068. throw new ArgumentNullException(nameof(selector));
  3069. #if CRIPPLED_REFLECTION
  3070. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3071. #else
  3072. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3073. #endif
  3074. }
  3075. public static Task<decimal?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal?>>> selector, CancellationToken cancellationToken)
  3076. {
  3077. if (source == null)
  3078. throw new ArgumentNullException(nameof(source));
  3079. if (selector == null)
  3080. throw new ArgumentNullException(nameof(selector));
  3081. #if CRIPPLED_REFLECTION
  3082. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3083. #else
  3084. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3085. #endif
  3086. }
  3087. public static Task<decimal> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal>>> selector, CancellationToken cancellationToken)
  3088. {
  3089. if (source == null)
  3090. throw new ArgumentNullException(nameof(source));
  3091. if (selector == null)
  3092. throw new ArgumentNullException(nameof(selector));
  3093. #if CRIPPLED_REFLECTION
  3094. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3095. #else
  3096. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3097. #endif
  3098. }
  3099. public static Task<double?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double?>>> selector, CancellationToken cancellationToken)
  3100. {
  3101. if (source == null)
  3102. throw new ArgumentNullException(nameof(source));
  3103. if (selector == null)
  3104. throw new ArgumentNullException(nameof(selector));
  3105. #if CRIPPLED_REFLECTION
  3106. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3107. #else
  3108. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3109. #endif
  3110. }
  3111. public static Task<double> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double>>> selector, CancellationToken cancellationToken)
  3112. {
  3113. if (source == null)
  3114. throw new ArgumentNullException(nameof(source));
  3115. if (selector == null)
  3116. throw new ArgumentNullException(nameof(selector));
  3117. #if CRIPPLED_REFLECTION
  3118. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3119. #else
  3120. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3121. #endif
  3122. }
  3123. public static Task<float?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float?>>> selector, CancellationToken cancellationToken)
  3124. {
  3125. if (source == null)
  3126. throw new ArgumentNullException(nameof(source));
  3127. if (selector == null)
  3128. throw new ArgumentNullException(nameof(selector));
  3129. #if CRIPPLED_REFLECTION
  3130. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3131. #else
  3132. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3133. #endif
  3134. }
  3135. public static Task<float> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float>>> selector, CancellationToken cancellationToken)
  3136. {
  3137. if (source == null)
  3138. throw new ArgumentNullException(nameof(source));
  3139. if (selector == null)
  3140. throw new ArgumentNullException(nameof(selector));
  3141. #if CRIPPLED_REFLECTION
  3142. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3143. #else
  3144. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3145. #endif
  3146. }
  3147. public static Task<int?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int?>>> selector, CancellationToken cancellationToken)
  3148. {
  3149. if (source == null)
  3150. throw new ArgumentNullException(nameof(source));
  3151. if (selector == null)
  3152. throw new ArgumentNullException(nameof(selector));
  3153. #if CRIPPLED_REFLECTION
  3154. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3155. #else
  3156. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3157. #endif
  3158. }
  3159. public static Task<int> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int>>> selector, CancellationToken cancellationToken)
  3160. {
  3161. if (source == null)
  3162. throw new ArgumentNullException(nameof(source));
  3163. if (selector == null)
  3164. throw new ArgumentNullException(nameof(selector));
  3165. #if CRIPPLED_REFLECTION
  3166. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3167. #else
  3168. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3169. #endif
  3170. }
  3171. public static Task<long?> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long?>>> selector, CancellationToken cancellationToken)
  3172. {
  3173. if (source == null)
  3174. throw new ArgumentNullException(nameof(source));
  3175. if (selector == null)
  3176. throw new ArgumentNullException(nameof(selector));
  3177. #if CRIPPLED_REFLECTION
  3178. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3179. #else
  3180. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3181. #endif
  3182. }
  3183. public static Task<long> MaxAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long>>> selector, CancellationToken cancellationToken)
  3184. {
  3185. if (source == null)
  3186. throw new ArgumentNullException(nameof(source));
  3187. if (selector == null)
  3188. throw new ArgumentNullException(nameof(selector));
  3189. #if CRIPPLED_REFLECTION
  3190. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3191. #else
  3192. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3193. #endif
  3194. }
  3195. public static Task<TResult> MaxAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
  3196. {
  3197. if (source == null)
  3198. throw new ArgumentNullException(nameof(source));
  3199. if (selector == null)
  3200. throw new ArgumentNullException(nameof(selector));
  3201. #if CRIPPLED_REFLECTION
  3202. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TResult>>))), source.Expression, selector), CancellationToken.None);
  3203. #else
  3204. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector), CancellationToken.None);
  3205. #endif
  3206. }
  3207. public static Task<TResult> MaxAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TResult>>> selector)
  3208. {
  3209. if (source == null)
  3210. throw new ArgumentNullException(nameof(source));
  3211. if (selector == null)
  3212. throw new ArgumentNullException(nameof(selector));
  3213. #if CRIPPLED_REFLECTION
  3214. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TResult>>>))), source.Expression, selector), CancellationToken.None);
  3215. #else
  3216. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector), CancellationToken.None);
  3217. #endif
  3218. }
  3219. public static Task<TResult> MaxAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TResult>>> selector, CancellationToken cancellationToken)
  3220. {
  3221. if (source == null)
  3222. throw new ArgumentNullException(nameof(source));
  3223. if (selector == null)
  3224. throw new ArgumentNullException(nameof(selector));
  3225. #if CRIPPLED_REFLECTION
  3226. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TResult>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3227. #else
  3228. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3229. #endif
  3230. }
  3231. public static Task<TResult> MaxAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken)
  3232. {
  3233. if (source == null)
  3234. throw new ArgumentNullException(nameof(source));
  3235. if (selector == null)
  3236. throw new ArgumentNullException(nameof(selector));
  3237. #if CRIPPLED_REFLECTION
  3238. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TResult>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3239. #else
  3240. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3241. #endif
  3242. }
  3243. public static Task<TResult> MaxAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TResult>>> selector, CancellationToken cancellationToken)
  3244. {
  3245. if (source == null)
  3246. throw new ArgumentNullException(nameof(source));
  3247. if (selector == null)
  3248. throw new ArgumentNullException(nameof(selector));
  3249. #if CRIPPLED_REFLECTION
  3250. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MaxAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TResult>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3251. #else
  3252. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3253. #endif
  3254. }
  3255. public static Task<decimal?> MinAsync(this IAsyncQueryable<decimal?> source)
  3256. {
  3257. if (source == null)
  3258. throw new ArgumentNullException(nameof(source));
  3259. #if CRIPPLED_REFLECTION
  3260. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<decimal?>))), source.Expression), CancellationToken.None);
  3261. #else
  3262. return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3263. #endif
  3264. }
  3265. public static Task<decimal> MinAsync(this IAsyncQueryable<decimal> source)
  3266. {
  3267. if (source == null)
  3268. throw new ArgumentNullException(nameof(source));
  3269. #if CRIPPLED_REFLECTION
  3270. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<decimal>))), source.Expression), CancellationToken.None);
  3271. #else
  3272. return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3273. #endif
  3274. }
  3275. public static Task<double?> MinAsync(this IAsyncQueryable<double?> source)
  3276. {
  3277. if (source == null)
  3278. throw new ArgumentNullException(nameof(source));
  3279. #if CRIPPLED_REFLECTION
  3280. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<double?>))), source.Expression), CancellationToken.None);
  3281. #else
  3282. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3283. #endif
  3284. }
  3285. public static Task<double> MinAsync(this IAsyncQueryable<double> source)
  3286. {
  3287. if (source == null)
  3288. throw new ArgumentNullException(nameof(source));
  3289. #if CRIPPLED_REFLECTION
  3290. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<double>))), source.Expression), CancellationToken.None);
  3291. #else
  3292. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3293. #endif
  3294. }
  3295. public static Task<float?> MinAsync(this IAsyncQueryable<float?> source)
  3296. {
  3297. if (source == null)
  3298. throw new ArgumentNullException(nameof(source));
  3299. #if CRIPPLED_REFLECTION
  3300. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<float?>))), source.Expression), CancellationToken.None);
  3301. #else
  3302. return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3303. #endif
  3304. }
  3305. public static Task<float> MinAsync(this IAsyncQueryable<float> source)
  3306. {
  3307. if (source == null)
  3308. throw new ArgumentNullException(nameof(source));
  3309. #if CRIPPLED_REFLECTION
  3310. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<float>))), source.Expression), CancellationToken.None);
  3311. #else
  3312. return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3313. #endif
  3314. }
  3315. public static Task<int?> MinAsync(this IAsyncQueryable<int?> source)
  3316. {
  3317. if (source == null)
  3318. throw new ArgumentNullException(nameof(source));
  3319. #if CRIPPLED_REFLECTION
  3320. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<int?>))), source.Expression), CancellationToken.None);
  3321. #else
  3322. return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3323. #endif
  3324. }
  3325. public static Task<int> MinAsync(this IAsyncQueryable<int> source)
  3326. {
  3327. if (source == null)
  3328. throw new ArgumentNullException(nameof(source));
  3329. #if CRIPPLED_REFLECTION
  3330. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<int>))), source.Expression), CancellationToken.None);
  3331. #else
  3332. return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3333. #endif
  3334. }
  3335. public static Task<long?> MinAsync(this IAsyncQueryable<long?> source)
  3336. {
  3337. if (source == null)
  3338. throw new ArgumentNullException(nameof(source));
  3339. #if CRIPPLED_REFLECTION
  3340. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<long?>))), source.Expression), CancellationToken.None);
  3341. #else
  3342. return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3343. #endif
  3344. }
  3345. public static Task<long> MinAsync(this IAsyncQueryable<long> source)
  3346. {
  3347. if (source == null)
  3348. throw new ArgumentNullException(nameof(source));
  3349. #if CRIPPLED_REFLECTION
  3350. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<long>))), source.Expression), CancellationToken.None);
  3351. #else
  3352. return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  3353. #endif
  3354. }
  3355. public static Task<decimal?> MinAsync(this IAsyncQueryable<decimal?> source, CancellationToken cancellationToken)
  3356. {
  3357. if (source == null)
  3358. throw new ArgumentNullException(nameof(source));
  3359. #if CRIPPLED_REFLECTION
  3360. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<decimal?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3361. #else
  3362. return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3363. #endif
  3364. }
  3365. public static Task<decimal> MinAsync(this IAsyncQueryable<decimal> source, CancellationToken cancellationToken)
  3366. {
  3367. if (source == null)
  3368. throw new ArgumentNullException(nameof(source));
  3369. #if CRIPPLED_REFLECTION
  3370. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<decimal>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3371. #else
  3372. return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3373. #endif
  3374. }
  3375. public static Task<double?> MinAsync(this IAsyncQueryable<double?> source, CancellationToken cancellationToken)
  3376. {
  3377. if (source == null)
  3378. throw new ArgumentNullException(nameof(source));
  3379. #if CRIPPLED_REFLECTION
  3380. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<double?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3381. #else
  3382. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3383. #endif
  3384. }
  3385. public static Task<double> MinAsync(this IAsyncQueryable<double> source, CancellationToken cancellationToken)
  3386. {
  3387. if (source == null)
  3388. throw new ArgumentNullException(nameof(source));
  3389. #if CRIPPLED_REFLECTION
  3390. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<double>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3391. #else
  3392. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3393. #endif
  3394. }
  3395. public static Task<float?> MinAsync(this IAsyncQueryable<float?> source, CancellationToken cancellationToken)
  3396. {
  3397. if (source == null)
  3398. throw new ArgumentNullException(nameof(source));
  3399. #if CRIPPLED_REFLECTION
  3400. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<float?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3401. #else
  3402. return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3403. #endif
  3404. }
  3405. public static Task<float> MinAsync(this IAsyncQueryable<float> source, CancellationToken cancellationToken)
  3406. {
  3407. if (source == null)
  3408. throw new ArgumentNullException(nameof(source));
  3409. #if CRIPPLED_REFLECTION
  3410. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<float>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3411. #else
  3412. return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3413. #endif
  3414. }
  3415. public static Task<int?> MinAsync(this IAsyncQueryable<int?> source, CancellationToken cancellationToken)
  3416. {
  3417. if (source == null)
  3418. throw new ArgumentNullException(nameof(source));
  3419. #if CRIPPLED_REFLECTION
  3420. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<int?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3421. #else
  3422. return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3423. #endif
  3424. }
  3425. public static Task<int> MinAsync(this IAsyncQueryable<int> source, CancellationToken cancellationToken)
  3426. {
  3427. if (source == null)
  3428. throw new ArgumentNullException(nameof(source));
  3429. #if CRIPPLED_REFLECTION
  3430. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<int>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3431. #else
  3432. return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3433. #endif
  3434. }
  3435. public static Task<long?> MinAsync(this IAsyncQueryable<long?> source, CancellationToken cancellationToken)
  3436. {
  3437. if (source == null)
  3438. throw new ArgumentNullException(nameof(source));
  3439. #if CRIPPLED_REFLECTION
  3440. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<long?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3441. #else
  3442. return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3443. #endif
  3444. }
  3445. public static Task<long> MinAsync(this IAsyncQueryable<long> source, CancellationToken cancellationToken)
  3446. {
  3447. if (source == null)
  3448. throw new ArgumentNullException(nameof(source));
  3449. #if CRIPPLED_REFLECTION
  3450. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync(default(IAsyncQueryable<long>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3451. #else
  3452. return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3453. #endif
  3454. }
  3455. public static Task<TSource> MinAsync<TSource>(this IAsyncQueryable<TSource> source)
  3456. {
  3457. if (source == null)
  3458. throw new ArgumentNullException(nameof(source));
  3459. #if CRIPPLED_REFLECTION
  3460. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  3461. #else
  3462. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  3463. #endif
  3464. }
  3465. public static Task<TSource> MinAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  3466. {
  3467. if (source == null)
  3468. throw new ArgumentNullException(nameof(source));
  3469. #if CRIPPLED_REFLECTION
  3470. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3471. #else
  3472. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3473. #endif
  3474. }
  3475. public static Task<decimal?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
  3476. {
  3477. if (source == null)
  3478. throw new ArgumentNullException(nameof(source));
  3479. if (selector == null)
  3480. throw new ArgumentNullException(nameof(selector));
  3481. #if CRIPPLED_REFLECTION
  3482. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal?>>))), source.Expression, selector), CancellationToken.None);
  3483. #else
  3484. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3485. #endif
  3486. }
  3487. public static Task<decimal> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
  3488. {
  3489. if (source == null)
  3490. throw new ArgumentNullException(nameof(source));
  3491. if (selector == null)
  3492. throw new ArgumentNullException(nameof(selector));
  3493. #if CRIPPLED_REFLECTION
  3494. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal>>))), source.Expression, selector), CancellationToken.None);
  3495. #else
  3496. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3497. #endif
  3498. }
  3499. public static Task<double?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
  3500. {
  3501. if (source == null)
  3502. throw new ArgumentNullException(nameof(source));
  3503. if (selector == null)
  3504. throw new ArgumentNullException(nameof(selector));
  3505. #if CRIPPLED_REFLECTION
  3506. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double?>>))), source.Expression, selector), CancellationToken.None);
  3507. #else
  3508. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3509. #endif
  3510. }
  3511. public static Task<double> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector)
  3512. {
  3513. if (source == null)
  3514. throw new ArgumentNullException(nameof(source));
  3515. if (selector == null)
  3516. throw new ArgumentNullException(nameof(selector));
  3517. #if CRIPPLED_REFLECTION
  3518. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double>>))), source.Expression, selector), CancellationToken.None);
  3519. #else
  3520. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3521. #endif
  3522. }
  3523. public static Task<float?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
  3524. {
  3525. if (source == null)
  3526. throw new ArgumentNullException(nameof(source));
  3527. if (selector == null)
  3528. throw new ArgumentNullException(nameof(selector));
  3529. #if CRIPPLED_REFLECTION
  3530. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float?>>))), source.Expression, selector), CancellationToken.None);
  3531. #else
  3532. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3533. #endif
  3534. }
  3535. public static Task<float> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector)
  3536. {
  3537. if (source == null)
  3538. throw new ArgumentNullException(nameof(source));
  3539. if (selector == null)
  3540. throw new ArgumentNullException(nameof(selector));
  3541. #if CRIPPLED_REFLECTION
  3542. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float>>))), source.Expression, selector), CancellationToken.None);
  3543. #else
  3544. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3545. #endif
  3546. }
  3547. public static Task<int?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
  3548. {
  3549. if (source == null)
  3550. throw new ArgumentNullException(nameof(source));
  3551. if (selector == null)
  3552. throw new ArgumentNullException(nameof(selector));
  3553. #if CRIPPLED_REFLECTION
  3554. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int?>>))), source.Expression, selector), CancellationToken.None);
  3555. #else
  3556. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3557. #endif
  3558. }
  3559. public static Task<int> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector)
  3560. {
  3561. if (source == null)
  3562. throw new ArgumentNullException(nameof(source));
  3563. if (selector == null)
  3564. throw new ArgumentNullException(nameof(selector));
  3565. #if CRIPPLED_REFLECTION
  3566. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int>>))), source.Expression, selector), CancellationToken.None);
  3567. #else
  3568. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3569. #endif
  3570. }
  3571. public static Task<long?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
  3572. {
  3573. if (source == null)
  3574. throw new ArgumentNullException(nameof(source));
  3575. if (selector == null)
  3576. throw new ArgumentNullException(nameof(selector));
  3577. #if CRIPPLED_REFLECTION
  3578. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long?>>))), source.Expression, selector), CancellationToken.None);
  3579. #else
  3580. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3581. #endif
  3582. }
  3583. public static Task<long> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector)
  3584. {
  3585. if (source == null)
  3586. throw new ArgumentNullException(nameof(source));
  3587. if (selector == null)
  3588. throw new ArgumentNullException(nameof(selector));
  3589. #if CRIPPLED_REFLECTION
  3590. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long>>))), source.Expression, selector), CancellationToken.None);
  3591. #else
  3592. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3593. #endif
  3594. }
  3595. public static Task<decimal?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal?>>> selector)
  3596. {
  3597. if (source == null)
  3598. throw new ArgumentNullException(nameof(source));
  3599. if (selector == null)
  3600. throw new ArgumentNullException(nameof(selector));
  3601. #if CRIPPLED_REFLECTION
  3602. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal?>>>))), source.Expression, selector), CancellationToken.None);
  3603. #else
  3604. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3605. #endif
  3606. }
  3607. public static Task<decimal> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal>>> selector)
  3608. {
  3609. if (source == null)
  3610. throw new ArgumentNullException(nameof(source));
  3611. if (selector == null)
  3612. throw new ArgumentNullException(nameof(selector));
  3613. #if CRIPPLED_REFLECTION
  3614. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal>>>))), source.Expression, selector), CancellationToken.None);
  3615. #else
  3616. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3617. #endif
  3618. }
  3619. public static Task<double?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double?>>> selector)
  3620. {
  3621. if (source == null)
  3622. throw new ArgumentNullException(nameof(source));
  3623. if (selector == null)
  3624. throw new ArgumentNullException(nameof(selector));
  3625. #if CRIPPLED_REFLECTION
  3626. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double?>>>))), source.Expression, selector), CancellationToken.None);
  3627. #else
  3628. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3629. #endif
  3630. }
  3631. public static Task<double> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double>>> selector)
  3632. {
  3633. if (source == null)
  3634. throw new ArgumentNullException(nameof(source));
  3635. if (selector == null)
  3636. throw new ArgumentNullException(nameof(selector));
  3637. #if CRIPPLED_REFLECTION
  3638. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double>>>))), source.Expression, selector), CancellationToken.None);
  3639. #else
  3640. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3641. #endif
  3642. }
  3643. public static Task<float?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float?>>> selector)
  3644. {
  3645. if (source == null)
  3646. throw new ArgumentNullException(nameof(source));
  3647. if (selector == null)
  3648. throw new ArgumentNullException(nameof(selector));
  3649. #if CRIPPLED_REFLECTION
  3650. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float?>>>))), source.Expression, selector), CancellationToken.None);
  3651. #else
  3652. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3653. #endif
  3654. }
  3655. public static Task<float> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float>>> selector)
  3656. {
  3657. if (source == null)
  3658. throw new ArgumentNullException(nameof(source));
  3659. if (selector == null)
  3660. throw new ArgumentNullException(nameof(selector));
  3661. #if CRIPPLED_REFLECTION
  3662. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float>>>))), source.Expression, selector), CancellationToken.None);
  3663. #else
  3664. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3665. #endif
  3666. }
  3667. public static Task<int?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int?>>> selector)
  3668. {
  3669. if (source == null)
  3670. throw new ArgumentNullException(nameof(source));
  3671. if (selector == null)
  3672. throw new ArgumentNullException(nameof(selector));
  3673. #if CRIPPLED_REFLECTION
  3674. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int?>>>))), source.Expression, selector), CancellationToken.None);
  3675. #else
  3676. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3677. #endif
  3678. }
  3679. public static Task<int> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int>>> selector)
  3680. {
  3681. if (source == null)
  3682. throw new ArgumentNullException(nameof(source));
  3683. if (selector == null)
  3684. throw new ArgumentNullException(nameof(selector));
  3685. #if CRIPPLED_REFLECTION
  3686. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int>>>))), source.Expression, selector), CancellationToken.None);
  3687. #else
  3688. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3689. #endif
  3690. }
  3691. public static Task<long?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long?>>> selector)
  3692. {
  3693. if (source == null)
  3694. throw new ArgumentNullException(nameof(source));
  3695. if (selector == null)
  3696. throw new ArgumentNullException(nameof(selector));
  3697. #if CRIPPLED_REFLECTION
  3698. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long?>>>))), source.Expression, selector), CancellationToken.None);
  3699. #else
  3700. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3701. #endif
  3702. }
  3703. public static Task<long> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long>>> selector)
  3704. {
  3705. if (source == null)
  3706. throw new ArgumentNullException(nameof(source));
  3707. if (selector == null)
  3708. throw new ArgumentNullException(nameof(selector));
  3709. #if CRIPPLED_REFLECTION
  3710. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long>>>))), source.Expression, selector), CancellationToken.None);
  3711. #else
  3712. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  3713. #endif
  3714. }
  3715. public static Task<decimal?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<decimal?>>> selector, CancellationToken cancellationToken)
  3716. {
  3717. if (source == null)
  3718. throw new ArgumentNullException(nameof(source));
  3719. if (selector == null)
  3720. throw new ArgumentNullException(nameof(selector));
  3721. #if CRIPPLED_REFLECTION
  3722. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<decimal?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3723. #else
  3724. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3725. #endif
  3726. }
  3727. public static Task<decimal> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<decimal>>> selector, CancellationToken cancellationToken)
  3728. {
  3729. if (source == null)
  3730. throw new ArgumentNullException(nameof(source));
  3731. if (selector == null)
  3732. throw new ArgumentNullException(nameof(selector));
  3733. #if CRIPPLED_REFLECTION
  3734. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<decimal>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3735. #else
  3736. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3737. #endif
  3738. }
  3739. public static Task<double?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<double?>>> selector, CancellationToken cancellationToken)
  3740. {
  3741. if (source == null)
  3742. throw new ArgumentNullException(nameof(source));
  3743. if (selector == null)
  3744. throw new ArgumentNullException(nameof(selector));
  3745. #if CRIPPLED_REFLECTION
  3746. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<double?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3747. #else
  3748. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3749. #endif
  3750. }
  3751. public static Task<double> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<double>>> selector, CancellationToken cancellationToken)
  3752. {
  3753. if (source == null)
  3754. throw new ArgumentNullException(nameof(source));
  3755. if (selector == null)
  3756. throw new ArgumentNullException(nameof(selector));
  3757. #if CRIPPLED_REFLECTION
  3758. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<double>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3759. #else
  3760. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3761. #endif
  3762. }
  3763. public static Task<float?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<float?>>> selector, CancellationToken cancellationToken)
  3764. {
  3765. if (source == null)
  3766. throw new ArgumentNullException(nameof(source));
  3767. if (selector == null)
  3768. throw new ArgumentNullException(nameof(selector));
  3769. #if CRIPPLED_REFLECTION
  3770. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<float?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3771. #else
  3772. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3773. #endif
  3774. }
  3775. public static Task<float> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<float>>> selector, CancellationToken cancellationToken)
  3776. {
  3777. if (source == null)
  3778. throw new ArgumentNullException(nameof(source));
  3779. if (selector == null)
  3780. throw new ArgumentNullException(nameof(selector));
  3781. #if CRIPPLED_REFLECTION
  3782. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<float>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3783. #else
  3784. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3785. #endif
  3786. }
  3787. public static Task<int?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<int?>>> selector, CancellationToken cancellationToken)
  3788. {
  3789. if (source == null)
  3790. throw new ArgumentNullException(nameof(source));
  3791. if (selector == null)
  3792. throw new ArgumentNullException(nameof(selector));
  3793. #if CRIPPLED_REFLECTION
  3794. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<int?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3795. #else
  3796. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3797. #endif
  3798. }
  3799. public static Task<int> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<int>>> selector, CancellationToken cancellationToken)
  3800. {
  3801. if (source == null)
  3802. throw new ArgumentNullException(nameof(source));
  3803. if (selector == null)
  3804. throw new ArgumentNullException(nameof(selector));
  3805. #if CRIPPLED_REFLECTION
  3806. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<int>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3807. #else
  3808. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3809. #endif
  3810. }
  3811. public static Task<long?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<long?>>> selector, CancellationToken cancellationToken)
  3812. {
  3813. if (source == null)
  3814. throw new ArgumentNullException(nameof(source));
  3815. if (selector == null)
  3816. throw new ArgumentNullException(nameof(selector));
  3817. #if CRIPPLED_REFLECTION
  3818. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<long?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3819. #else
  3820. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3821. #endif
  3822. }
  3823. public static Task<long> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<long>>> selector, CancellationToken cancellationToken)
  3824. {
  3825. if (source == null)
  3826. throw new ArgumentNullException(nameof(source));
  3827. if (selector == null)
  3828. throw new ArgumentNullException(nameof(selector));
  3829. #if CRIPPLED_REFLECTION
  3830. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<long>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3831. #else
  3832. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3833. #endif
  3834. }
  3835. public static Task<decimal?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken)
  3836. {
  3837. if (source == null)
  3838. throw new ArgumentNullException(nameof(source));
  3839. if (selector == null)
  3840. throw new ArgumentNullException(nameof(selector));
  3841. #if CRIPPLED_REFLECTION
  3842. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3843. #else
  3844. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3845. #endif
  3846. }
  3847. public static Task<decimal> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken)
  3848. {
  3849. if (source == null)
  3850. throw new ArgumentNullException(nameof(source));
  3851. if (selector == null)
  3852. throw new ArgumentNullException(nameof(selector));
  3853. #if CRIPPLED_REFLECTION
  3854. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3855. #else
  3856. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3857. #endif
  3858. }
  3859. public static Task<double?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken)
  3860. {
  3861. if (source == null)
  3862. throw new ArgumentNullException(nameof(source));
  3863. if (selector == null)
  3864. throw new ArgumentNullException(nameof(selector));
  3865. #if CRIPPLED_REFLECTION
  3866. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3867. #else
  3868. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3869. #endif
  3870. }
  3871. public static Task<double> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken)
  3872. {
  3873. if (source == null)
  3874. throw new ArgumentNullException(nameof(source));
  3875. if (selector == null)
  3876. throw new ArgumentNullException(nameof(selector));
  3877. #if CRIPPLED_REFLECTION
  3878. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3879. #else
  3880. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3881. #endif
  3882. }
  3883. public static Task<float?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken)
  3884. {
  3885. if (source == null)
  3886. throw new ArgumentNullException(nameof(source));
  3887. if (selector == null)
  3888. throw new ArgumentNullException(nameof(selector));
  3889. #if CRIPPLED_REFLECTION
  3890. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3891. #else
  3892. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3893. #endif
  3894. }
  3895. public static Task<float> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken)
  3896. {
  3897. if (source == null)
  3898. throw new ArgumentNullException(nameof(source));
  3899. if (selector == null)
  3900. throw new ArgumentNullException(nameof(selector));
  3901. #if CRIPPLED_REFLECTION
  3902. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3903. #else
  3904. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3905. #endif
  3906. }
  3907. public static Task<int?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken)
  3908. {
  3909. if (source == null)
  3910. throw new ArgumentNullException(nameof(source));
  3911. if (selector == null)
  3912. throw new ArgumentNullException(nameof(selector));
  3913. #if CRIPPLED_REFLECTION
  3914. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3915. #else
  3916. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3917. #endif
  3918. }
  3919. public static Task<int> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken)
  3920. {
  3921. if (source == null)
  3922. throw new ArgumentNullException(nameof(source));
  3923. if (selector == null)
  3924. throw new ArgumentNullException(nameof(selector));
  3925. #if CRIPPLED_REFLECTION
  3926. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3927. #else
  3928. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3929. #endif
  3930. }
  3931. public static Task<long?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken)
  3932. {
  3933. if (source == null)
  3934. throw new ArgumentNullException(nameof(source));
  3935. if (selector == null)
  3936. throw new ArgumentNullException(nameof(selector));
  3937. #if CRIPPLED_REFLECTION
  3938. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3939. #else
  3940. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3941. #endif
  3942. }
  3943. public static Task<long> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken)
  3944. {
  3945. if (source == null)
  3946. throw new ArgumentNullException(nameof(source));
  3947. if (selector == null)
  3948. throw new ArgumentNullException(nameof(selector));
  3949. #if CRIPPLED_REFLECTION
  3950. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3951. #else
  3952. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3953. #endif
  3954. }
  3955. public static Task<decimal?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal?>>> selector, CancellationToken cancellationToken)
  3956. {
  3957. if (source == null)
  3958. throw new ArgumentNullException(nameof(source));
  3959. if (selector == null)
  3960. throw new ArgumentNullException(nameof(selector));
  3961. #if CRIPPLED_REFLECTION
  3962. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3963. #else
  3964. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3965. #endif
  3966. }
  3967. public static Task<decimal> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal>>> selector, CancellationToken cancellationToken)
  3968. {
  3969. if (source == null)
  3970. throw new ArgumentNullException(nameof(source));
  3971. if (selector == null)
  3972. throw new ArgumentNullException(nameof(selector));
  3973. #if CRIPPLED_REFLECTION
  3974. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3975. #else
  3976. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3977. #endif
  3978. }
  3979. public static Task<double?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double?>>> selector, CancellationToken cancellationToken)
  3980. {
  3981. if (source == null)
  3982. throw new ArgumentNullException(nameof(source));
  3983. if (selector == null)
  3984. throw new ArgumentNullException(nameof(selector));
  3985. #if CRIPPLED_REFLECTION
  3986. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3987. #else
  3988. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3989. #endif
  3990. }
  3991. public static Task<double> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double>>> selector, CancellationToken cancellationToken)
  3992. {
  3993. if (source == null)
  3994. throw new ArgumentNullException(nameof(source));
  3995. if (selector == null)
  3996. throw new ArgumentNullException(nameof(selector));
  3997. #if CRIPPLED_REFLECTION
  3998. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  3999. #else
  4000. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4001. #endif
  4002. }
  4003. public static Task<float?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float?>>> selector, CancellationToken cancellationToken)
  4004. {
  4005. if (source == null)
  4006. throw new ArgumentNullException(nameof(source));
  4007. if (selector == null)
  4008. throw new ArgumentNullException(nameof(selector));
  4009. #if CRIPPLED_REFLECTION
  4010. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4011. #else
  4012. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4013. #endif
  4014. }
  4015. public static Task<float> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float>>> selector, CancellationToken cancellationToken)
  4016. {
  4017. if (source == null)
  4018. throw new ArgumentNullException(nameof(source));
  4019. if (selector == null)
  4020. throw new ArgumentNullException(nameof(selector));
  4021. #if CRIPPLED_REFLECTION
  4022. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4023. #else
  4024. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4025. #endif
  4026. }
  4027. public static Task<int?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int?>>> selector, CancellationToken cancellationToken)
  4028. {
  4029. if (source == null)
  4030. throw new ArgumentNullException(nameof(source));
  4031. if (selector == null)
  4032. throw new ArgumentNullException(nameof(selector));
  4033. #if CRIPPLED_REFLECTION
  4034. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4035. #else
  4036. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4037. #endif
  4038. }
  4039. public static Task<int> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int>>> selector, CancellationToken cancellationToken)
  4040. {
  4041. if (source == null)
  4042. throw new ArgumentNullException(nameof(source));
  4043. if (selector == null)
  4044. throw new ArgumentNullException(nameof(selector));
  4045. #if CRIPPLED_REFLECTION
  4046. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4047. #else
  4048. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4049. #endif
  4050. }
  4051. public static Task<long?> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long?>>> selector, CancellationToken cancellationToken)
  4052. {
  4053. if (source == null)
  4054. throw new ArgumentNullException(nameof(source));
  4055. if (selector == null)
  4056. throw new ArgumentNullException(nameof(selector));
  4057. #if CRIPPLED_REFLECTION
  4058. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4059. #else
  4060. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4061. #endif
  4062. }
  4063. public static Task<long> MinAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long>>> selector, CancellationToken cancellationToken)
  4064. {
  4065. if (source == null)
  4066. throw new ArgumentNullException(nameof(source));
  4067. if (selector == null)
  4068. throw new ArgumentNullException(nameof(selector));
  4069. #if CRIPPLED_REFLECTION
  4070. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4071. #else
  4072. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4073. #endif
  4074. }
  4075. public static Task<TResult> MinAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
  4076. {
  4077. if (source == null)
  4078. throw new ArgumentNullException(nameof(source));
  4079. if (selector == null)
  4080. throw new ArgumentNullException(nameof(selector));
  4081. #if CRIPPLED_REFLECTION
  4082. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TResult>>))), source.Expression, selector), CancellationToken.None);
  4083. #else
  4084. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector), CancellationToken.None);
  4085. #endif
  4086. }
  4087. public static Task<TResult> MinAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TResult>>> selector)
  4088. {
  4089. if (source == null)
  4090. throw new ArgumentNullException(nameof(source));
  4091. if (selector == null)
  4092. throw new ArgumentNullException(nameof(selector));
  4093. #if CRIPPLED_REFLECTION
  4094. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TResult>>>))), source.Expression, selector), CancellationToken.None);
  4095. #else
  4096. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector), CancellationToken.None);
  4097. #endif
  4098. }
  4099. public static Task<TResult> MinAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TResult>>> selector, CancellationToken cancellationToken)
  4100. {
  4101. if (source == null)
  4102. throw new ArgumentNullException(nameof(source));
  4103. if (selector == null)
  4104. throw new ArgumentNullException(nameof(selector));
  4105. #if CRIPPLED_REFLECTION
  4106. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TResult>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4107. #else
  4108. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4109. #endif
  4110. }
  4111. public static Task<TResult> MinAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken)
  4112. {
  4113. if (source == null)
  4114. throw new ArgumentNullException(nameof(source));
  4115. if (selector == null)
  4116. throw new ArgumentNullException(nameof(selector));
  4117. #if CRIPPLED_REFLECTION
  4118. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TResult>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4119. #else
  4120. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4121. #endif
  4122. }
  4123. public static Task<TResult> MinAsync<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TResult>>> selector, CancellationToken cancellationToken)
  4124. {
  4125. if (source == null)
  4126. throw new ArgumentNullException(nameof(source));
  4127. if (selector == null)
  4128. throw new ArgumentNullException(nameof(selector));
  4129. #if CRIPPLED_REFLECTION
  4130. return source.Provider.ExecuteAsync<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.MinAsync<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TResult>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4131. #else
  4132. return source.Provider.ExecuteAsync<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4133. #endif
  4134. }
  4135. public static IAsyncQueryable<TResult> OfType<TResult>(this IAsyncQueryable<object> source)
  4136. {
  4137. if (source == null)
  4138. throw new ArgumentNullException(nameof(source));
  4139. #if CRIPPLED_REFLECTION
  4140. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.OfType<TResult>(default(IAsyncQueryable<object>))), source.Expression));
  4141. #else
  4142. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), source.Expression));
  4143. #endif
  4144. }
  4145. public static IOrderedAsyncQueryable<TSource> OrderBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  4146. {
  4147. if (source == null)
  4148. throw new ArgumentNullException(nameof(source));
  4149. if (keySelector == null)
  4150. throw new ArgumentNullException(nameof(keySelector));
  4151. #if CRIPPLED_REFLECTION
  4152. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>))), source.Expression, keySelector));
  4153. #else
  4154. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  4155. #endif
  4156. }
  4157. public static IOrderedAsyncQueryable<TSource> OrderBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector)
  4158. {
  4159. if (source == null)
  4160. throw new ArgumentNullException(nameof(source));
  4161. if (keySelector == null)
  4162. throw new ArgumentNullException(nameof(keySelector));
  4163. #if CRIPPLED_REFLECTION
  4164. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>))), source.Expression, keySelector));
  4165. #else
  4166. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  4167. #endif
  4168. }
  4169. public static IOrderedAsyncQueryable<TSource> OrderBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer)
  4170. {
  4171. if (source == null)
  4172. throw new ArgumentNullException(nameof(source));
  4173. if (keySelector == null)
  4174. throw new ArgumentNullException(nameof(keySelector));
  4175. #if CRIPPLED_REFLECTION
  4176. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4177. #else
  4178. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4179. #endif
  4180. }
  4181. public static IOrderedAsyncQueryable<TSource> OrderBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
  4182. {
  4183. if (source == null)
  4184. throw new ArgumentNullException(nameof(source));
  4185. if (keySelector == null)
  4186. throw new ArgumentNullException(nameof(keySelector));
  4187. #if CRIPPLED_REFLECTION
  4188. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4189. #else
  4190. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4191. #endif
  4192. }
  4193. public static IOrderedAsyncQueryable<TSource> OrderBy<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer)
  4194. {
  4195. if (source == null)
  4196. throw new ArgumentNullException(nameof(source));
  4197. if (keySelector == null)
  4198. throw new ArgumentNullException(nameof(keySelector));
  4199. #if CRIPPLED_REFLECTION
  4200. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderBy<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4201. #else
  4202. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4203. #endif
  4204. }
  4205. public static IOrderedAsyncQueryable<TSource> OrderByDescending<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector)
  4206. {
  4207. if (source == null)
  4208. throw new ArgumentNullException(nameof(source));
  4209. if (keySelector == null)
  4210. throw new ArgumentNullException(nameof(keySelector));
  4211. #if CRIPPLED_REFLECTION
  4212. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderByDescending<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>))), source.Expression, keySelector));
  4213. #else
  4214. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  4215. #endif
  4216. }
  4217. public static IOrderedAsyncQueryable<TSource> OrderByDescending<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  4218. {
  4219. if (source == null)
  4220. throw new ArgumentNullException(nameof(source));
  4221. if (keySelector == null)
  4222. throw new ArgumentNullException(nameof(keySelector));
  4223. #if CRIPPLED_REFLECTION
  4224. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderByDescending<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>))), source.Expression, keySelector));
  4225. #else
  4226. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  4227. #endif
  4228. }
  4229. public static IOrderedAsyncQueryable<TSource> OrderByDescending<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector)
  4230. {
  4231. if (source == null)
  4232. throw new ArgumentNullException(nameof(source));
  4233. if (keySelector == null)
  4234. throw new ArgumentNullException(nameof(keySelector));
  4235. #if CRIPPLED_REFLECTION
  4236. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderByDescending<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>))), source.Expression, keySelector));
  4237. #else
  4238. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  4239. #endif
  4240. }
  4241. public static IOrderedAsyncQueryable<TSource> OrderByDescending<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer)
  4242. {
  4243. if (source == null)
  4244. throw new ArgumentNullException(nameof(source));
  4245. if (keySelector == null)
  4246. throw new ArgumentNullException(nameof(keySelector));
  4247. #if CRIPPLED_REFLECTION
  4248. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderByDescending<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4249. #else
  4250. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4251. #endif
  4252. }
  4253. public static IOrderedAsyncQueryable<TSource> OrderByDescending<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
  4254. {
  4255. if (source == null)
  4256. throw new ArgumentNullException(nameof(source));
  4257. if (keySelector == null)
  4258. throw new ArgumentNullException(nameof(keySelector));
  4259. #if CRIPPLED_REFLECTION
  4260. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderByDescending<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4261. #else
  4262. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4263. #endif
  4264. }
  4265. public static IOrderedAsyncQueryable<TSource> OrderByDescending<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer)
  4266. {
  4267. if (source == null)
  4268. throw new ArgumentNullException(nameof(source));
  4269. if (keySelector == null)
  4270. throw new ArgumentNullException(nameof(keySelector));
  4271. #if CRIPPLED_REFLECTION
  4272. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.OrderByDescending<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4273. #else
  4274. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  4275. #endif
  4276. }
  4277. public static IAsyncQueryable<TSource> Prepend<TSource>(this IAsyncQueryable<TSource> source, TSource element)
  4278. {
  4279. if (source == null)
  4280. throw new ArgumentNullException(nameof(source));
  4281. #if CRIPPLED_REFLECTION
  4282. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Prepend<TSource>(default(IAsyncQueryable<TSource>), default(TSource))), source.Expression, Expression.Constant(element, typeof(TSource))));
  4283. #else
  4284. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(element, typeof(TSource))));
  4285. #endif
  4286. }
  4287. public static IAsyncQueryable<TSource> Reverse<TSource>(this IAsyncQueryable<TSource> source)
  4288. {
  4289. if (source == null)
  4290. throw new ArgumentNullException(nameof(source));
  4291. #if CRIPPLED_REFLECTION
  4292. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Reverse<TSource>(default(IAsyncQueryable<TSource>))), source.Expression));
  4293. #else
  4294. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression));
  4295. #endif
  4296. }
  4297. public static IAsyncQueryable<TResult> Select<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TResult>>> selector)
  4298. {
  4299. if (source == null)
  4300. throw new ArgumentNullException(nameof(source));
  4301. if (selector == null)
  4302. throw new ArgumentNullException(nameof(selector));
  4303. #if CRIPPLED_REFLECTION
  4304. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Select<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TResult>>>))), source.Expression, selector));
  4305. #else
  4306. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4307. #endif
  4308. }
  4309. public static IAsyncQueryable<TResult> Select<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, CancellationToken, ValueTask<TResult>>> selector)
  4310. {
  4311. if (source == null)
  4312. throw new ArgumentNullException(nameof(source));
  4313. if (selector == null)
  4314. throw new ArgumentNullException(nameof(selector));
  4315. #if CRIPPLED_REFLECTION
  4316. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Select<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, CancellationToken, ValueTask<TResult>>>))), source.Expression, selector));
  4317. #else
  4318. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4319. #endif
  4320. }
  4321. public static IAsyncQueryable<TResult> Select<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, TResult>> selector)
  4322. {
  4323. if (source == null)
  4324. throw new ArgumentNullException(nameof(source));
  4325. if (selector == null)
  4326. throw new ArgumentNullException(nameof(selector));
  4327. #if CRIPPLED_REFLECTION
  4328. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Select<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, TResult>>))), source.Expression, selector));
  4329. #else
  4330. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4331. #endif
  4332. }
  4333. public static IAsyncQueryable<TResult> Select<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, ValueTask<TResult>>> selector)
  4334. {
  4335. if (source == null)
  4336. throw new ArgumentNullException(nameof(source));
  4337. if (selector == null)
  4338. throw new ArgumentNullException(nameof(selector));
  4339. #if CRIPPLED_REFLECTION
  4340. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Select<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, ValueTask<TResult>>>))), source.Expression, selector));
  4341. #else
  4342. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4343. #endif
  4344. }
  4345. public static IAsyncQueryable<TResult> Select<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TResult>> selector)
  4346. {
  4347. if (source == null)
  4348. throw new ArgumentNullException(nameof(source));
  4349. if (selector == null)
  4350. throw new ArgumentNullException(nameof(selector));
  4351. #if CRIPPLED_REFLECTION
  4352. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Select<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TResult>>))), source.Expression, selector));
  4353. #else
  4354. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4355. #endif
  4356. }
  4357. public static IAsyncQueryable<TResult> Select<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TResult>>> selector)
  4358. {
  4359. if (source == null)
  4360. throw new ArgumentNullException(nameof(source));
  4361. if (selector == null)
  4362. throw new ArgumentNullException(nameof(selector));
  4363. #if CRIPPLED_REFLECTION
  4364. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Select<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TResult>>>))), source.Expression, selector));
  4365. #else
  4366. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4367. #endif
  4368. }
  4369. public static IAsyncQueryable<TResult> SelectMany<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<IAsyncEnumerable<TResult>>>> selector)
  4370. {
  4371. if (source == null)
  4372. throw new ArgumentNullException(nameof(source));
  4373. if (selector == null)
  4374. throw new ArgumentNullException(nameof(selector));
  4375. #if CRIPPLED_REFLECTION
  4376. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<IAsyncEnumerable<TResult>>>>))), source.Expression, selector));
  4377. #else
  4378. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4379. #endif
  4380. }
  4381. public static IAsyncQueryable<TResult> SelectMany<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, IAsyncEnumerable<TResult>>> selector)
  4382. {
  4383. if (source == null)
  4384. throw new ArgumentNullException(nameof(source));
  4385. if (selector == null)
  4386. throw new ArgumentNullException(nameof(selector));
  4387. #if CRIPPLED_REFLECTION
  4388. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, IAsyncEnumerable<TResult>>>))), source.Expression, selector));
  4389. #else
  4390. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4391. #endif
  4392. }
  4393. public static IAsyncQueryable<TResult> SelectMany<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, CancellationToken, ValueTask<IAsyncEnumerable<TResult>>>> selector)
  4394. {
  4395. if (source == null)
  4396. throw new ArgumentNullException(nameof(source));
  4397. if (selector == null)
  4398. throw new ArgumentNullException(nameof(selector));
  4399. #if CRIPPLED_REFLECTION
  4400. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, CancellationToken, ValueTask<IAsyncEnumerable<TResult>>>>))), source.Expression, selector));
  4401. #else
  4402. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4403. #endif
  4404. }
  4405. public static IAsyncQueryable<TResult> SelectMany<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, IAsyncEnumerable<TResult>>> selector)
  4406. {
  4407. if (source == null)
  4408. throw new ArgumentNullException(nameof(source));
  4409. if (selector == null)
  4410. throw new ArgumentNullException(nameof(selector));
  4411. #if CRIPPLED_REFLECTION
  4412. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, IAsyncEnumerable<TResult>>>))), source.Expression, selector));
  4413. #else
  4414. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4415. #endif
  4416. }
  4417. public static IAsyncQueryable<TResult> SelectMany<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, ValueTask<IAsyncEnumerable<TResult>>>> selector)
  4418. {
  4419. if (source == null)
  4420. throw new ArgumentNullException(nameof(source));
  4421. if (selector == null)
  4422. throw new ArgumentNullException(nameof(selector));
  4423. #if CRIPPLED_REFLECTION
  4424. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, ValueTask<IAsyncEnumerable<TResult>>>>))), source.Expression, selector));
  4425. #else
  4426. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4427. #endif
  4428. }
  4429. public static IAsyncQueryable<TResult> SelectMany<TSource, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<IAsyncEnumerable<TResult>>>> selector)
  4430. {
  4431. if (source == null)
  4432. throw new ArgumentNullException(nameof(source));
  4433. if (selector == null)
  4434. throw new ArgumentNullException(nameof(selector));
  4435. #if CRIPPLED_REFLECTION
  4436. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<IAsyncEnumerable<TResult>>>>))), source.Expression, selector));
  4437. #else
  4438. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), source.Expression, selector));
  4439. #endif
  4440. }
  4441. public static IAsyncQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<IAsyncEnumerable<TCollection>>>> selector, Expression<Func<TSource, TCollection, CancellationToken, ValueTask<TResult>>> resultSelector)
  4442. {
  4443. if (source == null)
  4444. throw new ArgumentNullException(nameof(source));
  4445. if (selector == null)
  4446. throw new ArgumentNullException(nameof(selector));
  4447. if (resultSelector == null)
  4448. throw new ArgumentNullException(nameof(resultSelector));
  4449. #if CRIPPLED_REFLECTION
  4450. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TCollection, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<IAsyncEnumerable<TCollection>>>>), default(Expression<Func<TSource, TCollection, CancellationToken, ValueTask<TResult>>>))), source.Expression, selector, resultSelector));
  4451. #else
  4452. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector));
  4453. #endif
  4454. }
  4455. public static IAsyncQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, IAsyncEnumerable<TCollection>>> selector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
  4456. {
  4457. if (source == null)
  4458. throw new ArgumentNullException(nameof(source));
  4459. if (selector == null)
  4460. throw new ArgumentNullException(nameof(selector));
  4461. if (resultSelector == null)
  4462. throw new ArgumentNullException(nameof(resultSelector));
  4463. #if CRIPPLED_REFLECTION
  4464. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TCollection, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, IAsyncEnumerable<TCollection>>>), default(Expression<Func<TSource, TCollection, TResult>>))), source.Expression, selector, resultSelector));
  4465. #else
  4466. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector));
  4467. #endif
  4468. }
  4469. public static IAsyncQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, CancellationToken, ValueTask<IAsyncEnumerable<TCollection>>>> selector, Expression<Func<TSource, TCollection, CancellationToken, ValueTask<TResult>>> resultSelector)
  4470. {
  4471. if (source == null)
  4472. throw new ArgumentNullException(nameof(source));
  4473. if (selector == null)
  4474. throw new ArgumentNullException(nameof(selector));
  4475. if (resultSelector == null)
  4476. throw new ArgumentNullException(nameof(resultSelector));
  4477. #if CRIPPLED_REFLECTION
  4478. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TCollection, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, CancellationToken, ValueTask<IAsyncEnumerable<TCollection>>>>), default(Expression<Func<TSource, TCollection, CancellationToken, ValueTask<TResult>>>))), source.Expression, selector, resultSelector));
  4479. #else
  4480. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector));
  4481. #endif
  4482. }
  4483. public static IAsyncQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, IAsyncEnumerable<TCollection>>> selector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
  4484. {
  4485. if (source == null)
  4486. throw new ArgumentNullException(nameof(source));
  4487. if (selector == null)
  4488. throw new ArgumentNullException(nameof(selector));
  4489. if (resultSelector == null)
  4490. throw new ArgumentNullException(nameof(resultSelector));
  4491. #if CRIPPLED_REFLECTION
  4492. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TCollection, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, IAsyncEnumerable<TCollection>>>), default(Expression<Func<TSource, TCollection, TResult>>))), source.Expression, selector, resultSelector));
  4493. #else
  4494. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector));
  4495. #endif
  4496. }
  4497. public static IAsyncQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, ValueTask<IAsyncEnumerable<TCollection>>>> selector, Expression<Func<TSource, TCollection, ValueTask<TResult>>> resultSelector)
  4498. {
  4499. if (source == null)
  4500. throw new ArgumentNullException(nameof(source));
  4501. if (selector == null)
  4502. throw new ArgumentNullException(nameof(selector));
  4503. if (resultSelector == null)
  4504. throw new ArgumentNullException(nameof(resultSelector));
  4505. #if CRIPPLED_REFLECTION
  4506. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TCollection, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, ValueTask<IAsyncEnumerable<TCollection>>>>), default(Expression<Func<TSource, TCollection, ValueTask<TResult>>>))), source.Expression, selector, resultSelector));
  4507. #else
  4508. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector));
  4509. #endif
  4510. }
  4511. public static IAsyncQueryable<TResult> SelectMany<TSource, TCollection, TResult>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<IAsyncEnumerable<TCollection>>>> selector, Expression<Func<TSource, TCollection, ValueTask<TResult>>> resultSelector)
  4512. {
  4513. if (source == null)
  4514. throw new ArgumentNullException(nameof(source));
  4515. if (selector == null)
  4516. throw new ArgumentNullException(nameof(selector));
  4517. if (resultSelector == null)
  4518. throw new ArgumentNullException(nameof(resultSelector));
  4519. #if CRIPPLED_REFLECTION
  4520. return source.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.SelectMany<TSource, TCollection, TResult>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<IAsyncEnumerable<TCollection>>>>), default(Expression<Func<TSource, TCollection, ValueTask<TResult>>>))), source.Expression, selector, resultSelector));
  4521. #else
  4522. return source.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), source.Expression, selector, resultSelector));
  4523. #endif
  4524. }
  4525. public static Task<bool> SequenceEqualAsync<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
  4526. {
  4527. if (first == null)
  4528. throw new ArgumentNullException(nameof(first));
  4529. if (second == null)
  4530. throw new ArgumentNullException(nameof(second));
  4531. #if CRIPPLED_REFLECTION
  4532. return first.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.SequenceEqualAsync<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>))), first.Expression, GetSourceExpression(second)), CancellationToken.None);
  4533. #else
  4534. return first.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)), CancellationToken.None);
  4535. #endif
  4536. }
  4537. public static Task<bool> SequenceEqualAsync<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, CancellationToken cancellationToken)
  4538. {
  4539. if (first == null)
  4540. throw new ArgumentNullException(nameof(first));
  4541. if (second == null)
  4542. throw new ArgumentNullException(nameof(second));
  4543. #if CRIPPLED_REFLECTION
  4544. return first.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.SequenceEqualAsync<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>), default(CancellationToken))), first.Expression, GetSourceExpression(second), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4545. #else
  4546. return first.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4547. #endif
  4548. }
  4549. public static Task<bool> SequenceEqualAsync<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
  4550. {
  4551. if (first == null)
  4552. throw new ArgumentNullException(nameof(first));
  4553. if (second == null)
  4554. throw new ArgumentNullException(nameof(second));
  4555. #if CRIPPLED_REFLECTION
  4556. return first.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.SequenceEqualAsync<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>), default(IEqualityComparer<TSource>))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))), CancellationToken.None);
  4557. #else
  4558. return first.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))), CancellationToken.None);
  4559. #endif
  4560. }
  4561. public static Task<bool> SequenceEqualAsync<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer, CancellationToken cancellationToken)
  4562. {
  4563. if (first == null)
  4564. throw new ArgumentNullException(nameof(first));
  4565. if (second == null)
  4566. throw new ArgumentNullException(nameof(second));
  4567. #if CRIPPLED_REFLECTION
  4568. return first.Provider.ExecuteAsync<bool>(Expression.Call(InfoOf(() => AsyncQueryable.SequenceEqualAsync<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>), default(IEqualityComparer<TSource>), default(CancellationToken))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4569. #else
  4570. return first.Provider.ExecuteAsync<bool>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4571. #endif
  4572. }
  4573. public static Task<TSource> SingleAsync<TSource>(this IAsyncQueryable<TSource> source)
  4574. {
  4575. if (source == null)
  4576. throw new ArgumentNullException(nameof(source));
  4577. #if CRIPPLED_REFLECTION
  4578. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  4579. #else
  4580. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  4581. #endif
  4582. }
  4583. public static Task<TSource> SingleAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  4584. {
  4585. if (source == null)
  4586. throw new ArgumentNullException(nameof(source));
  4587. #if CRIPPLED_REFLECTION
  4588. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4589. #else
  4590. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4591. #endif
  4592. }
  4593. public static Task<TSource> SingleAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  4594. {
  4595. if (source == null)
  4596. throw new ArgumentNullException(nameof(source));
  4597. if (predicate == null)
  4598. throw new ArgumentNullException(nameof(predicate));
  4599. #if CRIPPLED_REFLECTION
  4600. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  4601. #else
  4602. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  4603. #endif
  4604. }
  4605. public static Task<TSource> SingleAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  4606. {
  4607. if (source == null)
  4608. throw new ArgumentNullException(nameof(source));
  4609. if (predicate == null)
  4610. throw new ArgumentNullException(nameof(predicate));
  4611. #if CRIPPLED_REFLECTION
  4612. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  4613. #else
  4614. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  4615. #endif
  4616. }
  4617. public static Task<TSource> SingleAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  4618. {
  4619. if (source == null)
  4620. throw new ArgumentNullException(nameof(source));
  4621. if (predicate == null)
  4622. throw new ArgumentNullException(nameof(predicate));
  4623. #if CRIPPLED_REFLECTION
  4624. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4625. #else
  4626. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4627. #endif
  4628. }
  4629. public static Task<TSource> SingleAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  4630. {
  4631. if (source == null)
  4632. throw new ArgumentNullException(nameof(source));
  4633. if (predicate == null)
  4634. throw new ArgumentNullException(nameof(predicate));
  4635. #if CRIPPLED_REFLECTION
  4636. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4637. #else
  4638. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4639. #endif
  4640. }
  4641. public static Task<TSource> SingleAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  4642. {
  4643. if (source == null)
  4644. throw new ArgumentNullException(nameof(source));
  4645. if (predicate == null)
  4646. throw new ArgumentNullException(nameof(predicate));
  4647. #if CRIPPLED_REFLECTION
  4648. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4649. #else
  4650. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4651. #endif
  4652. }
  4653. public static Task<TSource> SingleOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source)
  4654. {
  4655. if (source == null)
  4656. throw new ArgumentNullException(nameof(source));
  4657. #if CRIPPLED_REFLECTION
  4658. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  4659. #else
  4660. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  4661. #endif
  4662. }
  4663. public static Task<TSource> SingleOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  4664. {
  4665. if (source == null)
  4666. throw new ArgumentNullException(nameof(source));
  4667. #if CRIPPLED_REFLECTION
  4668. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4669. #else
  4670. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4671. #endif
  4672. }
  4673. public static Task<TSource> SingleOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  4674. {
  4675. if (source == null)
  4676. throw new ArgumentNullException(nameof(source));
  4677. if (predicate == null)
  4678. throw new ArgumentNullException(nameof(predicate));
  4679. #if CRIPPLED_REFLECTION
  4680. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate), CancellationToken.None);
  4681. #else
  4682. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  4683. #endif
  4684. }
  4685. public static Task<TSource> SingleOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  4686. {
  4687. if (source == null)
  4688. throw new ArgumentNullException(nameof(source));
  4689. if (predicate == null)
  4690. throw new ArgumentNullException(nameof(predicate));
  4691. #if CRIPPLED_REFLECTION
  4692. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate), CancellationToken.None);
  4693. #else
  4694. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate), CancellationToken.None);
  4695. #endif
  4696. }
  4697. public static Task<TSource> SingleOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken)
  4698. {
  4699. if (source == null)
  4700. throw new ArgumentNullException(nameof(source));
  4701. if (predicate == null)
  4702. throw new ArgumentNullException(nameof(predicate));
  4703. #if CRIPPLED_REFLECTION
  4704. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4705. #else
  4706. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4707. #endif
  4708. }
  4709. public static Task<TSource> SingleOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  4710. {
  4711. if (source == null)
  4712. throw new ArgumentNullException(nameof(source));
  4713. if (predicate == null)
  4714. throw new ArgumentNullException(nameof(predicate));
  4715. #if CRIPPLED_REFLECTION
  4716. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4717. #else
  4718. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4719. #endif
  4720. }
  4721. public static Task<TSource> SingleOrDefaultAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate, CancellationToken cancellationToken)
  4722. {
  4723. if (source == null)
  4724. throw new ArgumentNullException(nameof(source));
  4725. if (predicate == null)
  4726. throw new ArgumentNullException(nameof(predicate));
  4727. #if CRIPPLED_REFLECTION
  4728. return source.Provider.ExecuteAsync<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SingleOrDefaultAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>), default(CancellationToken))), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4729. #else
  4730. return source.Provider.ExecuteAsync<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4731. #endif
  4732. }
  4733. public static IAsyncQueryable<TSource> Skip<TSource>(this IAsyncQueryable<TSource> source, int count)
  4734. {
  4735. if (source == null)
  4736. throw new ArgumentNullException(nameof(source));
  4737. #if CRIPPLED_REFLECTION
  4738. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Skip<TSource>(default(IAsyncQueryable<TSource>), default(int))), source.Expression, Expression.Constant(count, typeof(int))));
  4739. #else
  4740. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
  4741. #endif
  4742. }
  4743. public static IAsyncQueryable<TSource> SkipLast<TSource>(this IAsyncQueryable<TSource> source, int count)
  4744. {
  4745. if (source == null)
  4746. throw new ArgumentNullException(nameof(source));
  4747. #if CRIPPLED_REFLECTION
  4748. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SkipLast<TSource>(default(IAsyncQueryable<TSource>), default(int))), source.Expression, Expression.Constant(count, typeof(int))));
  4749. #else
  4750. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
  4751. #endif
  4752. }
  4753. public static IAsyncQueryable<TSource> SkipWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  4754. {
  4755. if (source == null)
  4756. throw new ArgumentNullException(nameof(source));
  4757. if (predicate == null)
  4758. throw new ArgumentNullException(nameof(predicate));
  4759. #if CRIPPLED_REFLECTION
  4760. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SkipWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate));
  4761. #else
  4762. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  4763. #endif
  4764. }
  4765. public static IAsyncQueryable<TSource> SkipWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate)
  4766. {
  4767. if (source == null)
  4768. throw new ArgumentNullException(nameof(source));
  4769. if (predicate == null)
  4770. throw new ArgumentNullException(nameof(predicate));
  4771. #if CRIPPLED_REFLECTION
  4772. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SkipWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>))), source.Expression, predicate));
  4773. #else
  4774. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  4775. #endif
  4776. }
  4777. public static IAsyncQueryable<TSource> SkipWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
  4778. {
  4779. if (source == null)
  4780. throw new ArgumentNullException(nameof(source));
  4781. if (predicate == null)
  4782. throw new ArgumentNullException(nameof(predicate));
  4783. #if CRIPPLED_REFLECTION
  4784. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SkipWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, bool>>))), source.Expression, predicate));
  4785. #else
  4786. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  4787. #endif
  4788. }
  4789. public static IAsyncQueryable<TSource> SkipWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, CancellationToken, ValueTask<bool>>> predicate)
  4790. {
  4791. if (source == null)
  4792. throw new ArgumentNullException(nameof(source));
  4793. if (predicate == null)
  4794. throw new ArgumentNullException(nameof(predicate));
  4795. #if CRIPPLED_REFLECTION
  4796. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SkipWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, CancellationToken, ValueTask<bool>>>))), source.Expression, predicate));
  4797. #else
  4798. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  4799. #endif
  4800. }
  4801. public static IAsyncQueryable<TSource> SkipWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, ValueTask<bool>>> predicate)
  4802. {
  4803. if (source == null)
  4804. throw new ArgumentNullException(nameof(source));
  4805. if (predicate == null)
  4806. throw new ArgumentNullException(nameof(predicate));
  4807. #if CRIPPLED_REFLECTION
  4808. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SkipWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, ValueTask<bool>>>))), source.Expression, predicate));
  4809. #else
  4810. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  4811. #endif
  4812. }
  4813. public static IAsyncQueryable<TSource> SkipWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  4814. {
  4815. if (source == null)
  4816. throw new ArgumentNullException(nameof(source));
  4817. if (predicate == null)
  4818. throw new ArgumentNullException(nameof(predicate));
  4819. #if CRIPPLED_REFLECTION
  4820. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.SkipWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate));
  4821. #else
  4822. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  4823. #endif
  4824. }
  4825. public static Task<decimal?> SumAsync(this IAsyncQueryable<decimal?> source)
  4826. {
  4827. if (source == null)
  4828. throw new ArgumentNullException(nameof(source));
  4829. #if CRIPPLED_REFLECTION
  4830. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<decimal?>))), source.Expression), CancellationToken.None);
  4831. #else
  4832. return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4833. #endif
  4834. }
  4835. public static Task<decimal> SumAsync(this IAsyncQueryable<decimal> source)
  4836. {
  4837. if (source == null)
  4838. throw new ArgumentNullException(nameof(source));
  4839. #if CRIPPLED_REFLECTION
  4840. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<decimal>))), source.Expression), CancellationToken.None);
  4841. #else
  4842. return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4843. #endif
  4844. }
  4845. public static Task<double?> SumAsync(this IAsyncQueryable<double?> source)
  4846. {
  4847. if (source == null)
  4848. throw new ArgumentNullException(nameof(source));
  4849. #if CRIPPLED_REFLECTION
  4850. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<double?>))), source.Expression), CancellationToken.None);
  4851. #else
  4852. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4853. #endif
  4854. }
  4855. public static Task<double> SumAsync(this IAsyncQueryable<double> source)
  4856. {
  4857. if (source == null)
  4858. throw new ArgumentNullException(nameof(source));
  4859. #if CRIPPLED_REFLECTION
  4860. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<double>))), source.Expression), CancellationToken.None);
  4861. #else
  4862. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4863. #endif
  4864. }
  4865. public static Task<float?> SumAsync(this IAsyncQueryable<float?> source)
  4866. {
  4867. if (source == null)
  4868. throw new ArgumentNullException(nameof(source));
  4869. #if CRIPPLED_REFLECTION
  4870. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<float?>))), source.Expression), CancellationToken.None);
  4871. #else
  4872. return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4873. #endif
  4874. }
  4875. public static Task<float> SumAsync(this IAsyncQueryable<float> source)
  4876. {
  4877. if (source == null)
  4878. throw new ArgumentNullException(nameof(source));
  4879. #if CRIPPLED_REFLECTION
  4880. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<float>))), source.Expression), CancellationToken.None);
  4881. #else
  4882. return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4883. #endif
  4884. }
  4885. public static Task<int?> SumAsync(this IAsyncQueryable<int?> source)
  4886. {
  4887. if (source == null)
  4888. throw new ArgumentNullException(nameof(source));
  4889. #if CRIPPLED_REFLECTION
  4890. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<int?>))), source.Expression), CancellationToken.None);
  4891. #else
  4892. return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4893. #endif
  4894. }
  4895. public static Task<int> SumAsync(this IAsyncQueryable<int> source)
  4896. {
  4897. if (source == null)
  4898. throw new ArgumentNullException(nameof(source));
  4899. #if CRIPPLED_REFLECTION
  4900. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<int>))), source.Expression), CancellationToken.None);
  4901. #else
  4902. return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4903. #endif
  4904. }
  4905. public static Task<long?> SumAsync(this IAsyncQueryable<long?> source)
  4906. {
  4907. if (source == null)
  4908. throw new ArgumentNullException(nameof(source));
  4909. #if CRIPPLED_REFLECTION
  4910. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<long?>))), source.Expression), CancellationToken.None);
  4911. #else
  4912. return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4913. #endif
  4914. }
  4915. public static Task<long> SumAsync(this IAsyncQueryable<long> source)
  4916. {
  4917. if (source == null)
  4918. throw new ArgumentNullException(nameof(source));
  4919. #if CRIPPLED_REFLECTION
  4920. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<long>))), source.Expression), CancellationToken.None);
  4921. #else
  4922. return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression), CancellationToken.None);
  4923. #endif
  4924. }
  4925. public static Task<decimal?> SumAsync(this IAsyncQueryable<decimal?> source, CancellationToken cancellationToken)
  4926. {
  4927. if (source == null)
  4928. throw new ArgumentNullException(nameof(source));
  4929. #if CRIPPLED_REFLECTION
  4930. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<decimal?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4931. #else
  4932. return source.Provider.ExecuteAsync<decimal?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4933. #endif
  4934. }
  4935. public static Task<decimal> SumAsync(this IAsyncQueryable<decimal> source, CancellationToken cancellationToken)
  4936. {
  4937. if (source == null)
  4938. throw new ArgumentNullException(nameof(source));
  4939. #if CRIPPLED_REFLECTION
  4940. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<decimal>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4941. #else
  4942. return source.Provider.ExecuteAsync<decimal>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4943. #endif
  4944. }
  4945. public static Task<double?> SumAsync(this IAsyncQueryable<double?> source, CancellationToken cancellationToken)
  4946. {
  4947. if (source == null)
  4948. throw new ArgumentNullException(nameof(source));
  4949. #if CRIPPLED_REFLECTION
  4950. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<double?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4951. #else
  4952. return source.Provider.ExecuteAsync<double?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4953. #endif
  4954. }
  4955. public static Task<double> SumAsync(this IAsyncQueryable<double> source, CancellationToken cancellationToken)
  4956. {
  4957. if (source == null)
  4958. throw new ArgumentNullException(nameof(source));
  4959. #if CRIPPLED_REFLECTION
  4960. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<double>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4961. #else
  4962. return source.Provider.ExecuteAsync<double>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4963. #endif
  4964. }
  4965. public static Task<float?> SumAsync(this IAsyncQueryable<float?> source, CancellationToken cancellationToken)
  4966. {
  4967. if (source == null)
  4968. throw new ArgumentNullException(nameof(source));
  4969. #if CRIPPLED_REFLECTION
  4970. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<float?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4971. #else
  4972. return source.Provider.ExecuteAsync<float?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4973. #endif
  4974. }
  4975. public static Task<float> SumAsync(this IAsyncQueryable<float> source, CancellationToken cancellationToken)
  4976. {
  4977. if (source == null)
  4978. throw new ArgumentNullException(nameof(source));
  4979. #if CRIPPLED_REFLECTION
  4980. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<float>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4981. #else
  4982. return source.Provider.ExecuteAsync<float>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4983. #endif
  4984. }
  4985. public static Task<int?> SumAsync(this IAsyncQueryable<int?> source, CancellationToken cancellationToken)
  4986. {
  4987. if (source == null)
  4988. throw new ArgumentNullException(nameof(source));
  4989. #if CRIPPLED_REFLECTION
  4990. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<int?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4991. #else
  4992. return source.Provider.ExecuteAsync<int?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  4993. #endif
  4994. }
  4995. public static Task<int> SumAsync(this IAsyncQueryable<int> source, CancellationToken cancellationToken)
  4996. {
  4997. if (source == null)
  4998. throw new ArgumentNullException(nameof(source));
  4999. #if CRIPPLED_REFLECTION
  5000. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<int>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5001. #else
  5002. return source.Provider.ExecuteAsync<int>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5003. #endif
  5004. }
  5005. public static Task<long?> SumAsync(this IAsyncQueryable<long?> source, CancellationToken cancellationToken)
  5006. {
  5007. if (source == null)
  5008. throw new ArgumentNullException(nameof(source));
  5009. #if CRIPPLED_REFLECTION
  5010. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<long?>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5011. #else
  5012. return source.Provider.ExecuteAsync<long?>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5013. #endif
  5014. }
  5015. public static Task<long> SumAsync(this IAsyncQueryable<long> source, CancellationToken cancellationToken)
  5016. {
  5017. if (source == null)
  5018. throw new ArgumentNullException(nameof(source));
  5019. #if CRIPPLED_REFLECTION
  5020. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync(default(IAsyncQueryable<long>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5021. #else
  5022. return source.Provider.ExecuteAsync<long>(Expression.Call((MethodInfo)MethodBase.GetCurrentMethod(), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5023. #endif
  5024. }
  5025. public static Task<decimal?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector)
  5026. {
  5027. if (source == null)
  5028. throw new ArgumentNullException(nameof(source));
  5029. if (selector == null)
  5030. throw new ArgumentNullException(nameof(selector));
  5031. #if CRIPPLED_REFLECTION
  5032. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal?>>))), source.Expression, selector), CancellationToken.None);
  5033. #else
  5034. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5035. #endif
  5036. }
  5037. public static Task<decimal> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector)
  5038. {
  5039. if (source == null)
  5040. throw new ArgumentNullException(nameof(source));
  5041. if (selector == null)
  5042. throw new ArgumentNullException(nameof(selector));
  5043. #if CRIPPLED_REFLECTION
  5044. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal>>))), source.Expression, selector), CancellationToken.None);
  5045. #else
  5046. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5047. #endif
  5048. }
  5049. public static Task<double?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector)
  5050. {
  5051. if (source == null)
  5052. throw new ArgumentNullException(nameof(source));
  5053. if (selector == null)
  5054. throw new ArgumentNullException(nameof(selector));
  5055. #if CRIPPLED_REFLECTION
  5056. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double?>>))), source.Expression, selector), CancellationToken.None);
  5057. #else
  5058. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5059. #endif
  5060. }
  5061. public static Task<double> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector)
  5062. {
  5063. if (source == null)
  5064. throw new ArgumentNullException(nameof(source));
  5065. if (selector == null)
  5066. throw new ArgumentNullException(nameof(selector));
  5067. #if CRIPPLED_REFLECTION
  5068. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double>>))), source.Expression, selector), CancellationToken.None);
  5069. #else
  5070. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5071. #endif
  5072. }
  5073. public static Task<float?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector)
  5074. {
  5075. if (source == null)
  5076. throw new ArgumentNullException(nameof(source));
  5077. if (selector == null)
  5078. throw new ArgumentNullException(nameof(selector));
  5079. #if CRIPPLED_REFLECTION
  5080. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float?>>))), source.Expression, selector), CancellationToken.None);
  5081. #else
  5082. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5083. #endif
  5084. }
  5085. public static Task<float> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector)
  5086. {
  5087. if (source == null)
  5088. throw new ArgumentNullException(nameof(source));
  5089. if (selector == null)
  5090. throw new ArgumentNullException(nameof(selector));
  5091. #if CRIPPLED_REFLECTION
  5092. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float>>))), source.Expression, selector), CancellationToken.None);
  5093. #else
  5094. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5095. #endif
  5096. }
  5097. public static Task<int?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector)
  5098. {
  5099. if (source == null)
  5100. throw new ArgumentNullException(nameof(source));
  5101. if (selector == null)
  5102. throw new ArgumentNullException(nameof(selector));
  5103. #if CRIPPLED_REFLECTION
  5104. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int?>>))), source.Expression, selector), CancellationToken.None);
  5105. #else
  5106. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5107. #endif
  5108. }
  5109. public static Task<int> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector)
  5110. {
  5111. if (source == null)
  5112. throw new ArgumentNullException(nameof(source));
  5113. if (selector == null)
  5114. throw new ArgumentNullException(nameof(selector));
  5115. #if CRIPPLED_REFLECTION
  5116. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int>>))), source.Expression, selector), CancellationToken.None);
  5117. #else
  5118. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5119. #endif
  5120. }
  5121. public static Task<long?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector)
  5122. {
  5123. if (source == null)
  5124. throw new ArgumentNullException(nameof(source));
  5125. if (selector == null)
  5126. throw new ArgumentNullException(nameof(selector));
  5127. #if CRIPPLED_REFLECTION
  5128. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long?>>))), source.Expression, selector), CancellationToken.None);
  5129. #else
  5130. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5131. #endif
  5132. }
  5133. public static Task<long> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector)
  5134. {
  5135. if (source == null)
  5136. throw new ArgumentNullException(nameof(source));
  5137. if (selector == null)
  5138. throw new ArgumentNullException(nameof(selector));
  5139. #if CRIPPLED_REFLECTION
  5140. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long>>))), source.Expression, selector), CancellationToken.None);
  5141. #else
  5142. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5143. #endif
  5144. }
  5145. public static Task<decimal?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal?>>> selector)
  5146. {
  5147. if (source == null)
  5148. throw new ArgumentNullException(nameof(source));
  5149. if (selector == null)
  5150. throw new ArgumentNullException(nameof(selector));
  5151. #if CRIPPLED_REFLECTION
  5152. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal?>>>))), source.Expression, selector), CancellationToken.None);
  5153. #else
  5154. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5155. #endif
  5156. }
  5157. public static Task<decimal> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal>>> selector)
  5158. {
  5159. if (source == null)
  5160. throw new ArgumentNullException(nameof(source));
  5161. if (selector == null)
  5162. throw new ArgumentNullException(nameof(selector));
  5163. #if CRIPPLED_REFLECTION
  5164. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal>>>))), source.Expression, selector), CancellationToken.None);
  5165. #else
  5166. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5167. #endif
  5168. }
  5169. public static Task<double?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double?>>> selector)
  5170. {
  5171. if (source == null)
  5172. throw new ArgumentNullException(nameof(source));
  5173. if (selector == null)
  5174. throw new ArgumentNullException(nameof(selector));
  5175. #if CRIPPLED_REFLECTION
  5176. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double?>>>))), source.Expression, selector), CancellationToken.None);
  5177. #else
  5178. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5179. #endif
  5180. }
  5181. public static Task<double> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double>>> selector)
  5182. {
  5183. if (source == null)
  5184. throw new ArgumentNullException(nameof(source));
  5185. if (selector == null)
  5186. throw new ArgumentNullException(nameof(selector));
  5187. #if CRIPPLED_REFLECTION
  5188. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double>>>))), source.Expression, selector), CancellationToken.None);
  5189. #else
  5190. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5191. #endif
  5192. }
  5193. public static Task<float?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float?>>> selector)
  5194. {
  5195. if (source == null)
  5196. throw new ArgumentNullException(nameof(source));
  5197. if (selector == null)
  5198. throw new ArgumentNullException(nameof(selector));
  5199. #if CRIPPLED_REFLECTION
  5200. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float?>>>))), source.Expression, selector), CancellationToken.None);
  5201. #else
  5202. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5203. #endif
  5204. }
  5205. public static Task<float> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float>>> selector)
  5206. {
  5207. if (source == null)
  5208. throw new ArgumentNullException(nameof(source));
  5209. if (selector == null)
  5210. throw new ArgumentNullException(nameof(selector));
  5211. #if CRIPPLED_REFLECTION
  5212. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float>>>))), source.Expression, selector), CancellationToken.None);
  5213. #else
  5214. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5215. #endif
  5216. }
  5217. public static Task<int?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int?>>> selector)
  5218. {
  5219. if (source == null)
  5220. throw new ArgumentNullException(nameof(source));
  5221. if (selector == null)
  5222. throw new ArgumentNullException(nameof(selector));
  5223. #if CRIPPLED_REFLECTION
  5224. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int?>>>))), source.Expression, selector), CancellationToken.None);
  5225. #else
  5226. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5227. #endif
  5228. }
  5229. public static Task<int> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int>>> selector)
  5230. {
  5231. if (source == null)
  5232. throw new ArgumentNullException(nameof(source));
  5233. if (selector == null)
  5234. throw new ArgumentNullException(nameof(selector));
  5235. #if CRIPPLED_REFLECTION
  5236. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int>>>))), source.Expression, selector), CancellationToken.None);
  5237. #else
  5238. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5239. #endif
  5240. }
  5241. public static Task<long?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long?>>> selector)
  5242. {
  5243. if (source == null)
  5244. throw new ArgumentNullException(nameof(source));
  5245. if (selector == null)
  5246. throw new ArgumentNullException(nameof(selector));
  5247. #if CRIPPLED_REFLECTION
  5248. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long?>>>))), source.Expression, selector), CancellationToken.None);
  5249. #else
  5250. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5251. #endif
  5252. }
  5253. public static Task<long> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long>>> selector)
  5254. {
  5255. if (source == null)
  5256. throw new ArgumentNullException(nameof(source));
  5257. if (selector == null)
  5258. throw new ArgumentNullException(nameof(selector));
  5259. #if CRIPPLED_REFLECTION
  5260. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long>>>))), source.Expression, selector), CancellationToken.None);
  5261. #else
  5262. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector), CancellationToken.None);
  5263. #endif
  5264. }
  5265. public static Task<decimal?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<decimal?>>> selector, CancellationToken cancellationToken)
  5266. {
  5267. if (source == null)
  5268. throw new ArgumentNullException(nameof(source));
  5269. if (selector == null)
  5270. throw new ArgumentNullException(nameof(selector));
  5271. #if CRIPPLED_REFLECTION
  5272. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<decimal?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5273. #else
  5274. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5275. #endif
  5276. }
  5277. public static Task<decimal> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<decimal>>> selector, CancellationToken cancellationToken)
  5278. {
  5279. if (source == null)
  5280. throw new ArgumentNullException(nameof(source));
  5281. if (selector == null)
  5282. throw new ArgumentNullException(nameof(selector));
  5283. #if CRIPPLED_REFLECTION
  5284. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<decimal>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5285. #else
  5286. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5287. #endif
  5288. }
  5289. public static Task<double?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<double?>>> selector, CancellationToken cancellationToken)
  5290. {
  5291. if (source == null)
  5292. throw new ArgumentNullException(nameof(source));
  5293. if (selector == null)
  5294. throw new ArgumentNullException(nameof(selector));
  5295. #if CRIPPLED_REFLECTION
  5296. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<double?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5297. #else
  5298. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5299. #endif
  5300. }
  5301. public static Task<double> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<double>>> selector, CancellationToken cancellationToken)
  5302. {
  5303. if (source == null)
  5304. throw new ArgumentNullException(nameof(source));
  5305. if (selector == null)
  5306. throw new ArgumentNullException(nameof(selector));
  5307. #if CRIPPLED_REFLECTION
  5308. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<double>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5309. #else
  5310. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5311. #endif
  5312. }
  5313. public static Task<float?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<float?>>> selector, CancellationToken cancellationToken)
  5314. {
  5315. if (source == null)
  5316. throw new ArgumentNullException(nameof(source));
  5317. if (selector == null)
  5318. throw new ArgumentNullException(nameof(selector));
  5319. #if CRIPPLED_REFLECTION
  5320. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<float?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5321. #else
  5322. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5323. #endif
  5324. }
  5325. public static Task<float> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<float>>> selector, CancellationToken cancellationToken)
  5326. {
  5327. if (source == null)
  5328. throw new ArgumentNullException(nameof(source));
  5329. if (selector == null)
  5330. throw new ArgumentNullException(nameof(selector));
  5331. #if CRIPPLED_REFLECTION
  5332. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<float>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5333. #else
  5334. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5335. #endif
  5336. }
  5337. public static Task<int?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<int?>>> selector, CancellationToken cancellationToken)
  5338. {
  5339. if (source == null)
  5340. throw new ArgumentNullException(nameof(source));
  5341. if (selector == null)
  5342. throw new ArgumentNullException(nameof(selector));
  5343. #if CRIPPLED_REFLECTION
  5344. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<int?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5345. #else
  5346. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5347. #endif
  5348. }
  5349. public static Task<int> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<int>>> selector, CancellationToken cancellationToken)
  5350. {
  5351. if (source == null)
  5352. throw new ArgumentNullException(nameof(source));
  5353. if (selector == null)
  5354. throw new ArgumentNullException(nameof(selector));
  5355. #if CRIPPLED_REFLECTION
  5356. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<int>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5357. #else
  5358. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5359. #endif
  5360. }
  5361. public static Task<long?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<long?>>> selector, CancellationToken cancellationToken)
  5362. {
  5363. if (source == null)
  5364. throw new ArgumentNullException(nameof(source));
  5365. if (selector == null)
  5366. throw new ArgumentNullException(nameof(selector));
  5367. #if CRIPPLED_REFLECTION
  5368. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<long?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5369. #else
  5370. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5371. #endif
  5372. }
  5373. public static Task<long> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<long>>> selector, CancellationToken cancellationToken)
  5374. {
  5375. if (source == null)
  5376. throw new ArgumentNullException(nameof(source));
  5377. if (selector == null)
  5378. throw new ArgumentNullException(nameof(selector));
  5379. #if CRIPPLED_REFLECTION
  5380. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<long>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5381. #else
  5382. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5383. #endif
  5384. }
  5385. public static Task<decimal?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken cancellationToken)
  5386. {
  5387. if (source == null)
  5388. throw new ArgumentNullException(nameof(source));
  5389. if (selector == null)
  5390. throw new ArgumentNullException(nameof(selector));
  5391. #if CRIPPLED_REFLECTION
  5392. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5393. #else
  5394. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5395. #endif
  5396. }
  5397. public static Task<decimal> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken)
  5398. {
  5399. if (source == null)
  5400. throw new ArgumentNullException(nameof(source));
  5401. if (selector == null)
  5402. throw new ArgumentNullException(nameof(selector));
  5403. #if CRIPPLED_REFLECTION
  5404. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, decimal>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5405. #else
  5406. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5407. #endif
  5408. }
  5409. public static Task<double?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken cancellationToken)
  5410. {
  5411. if (source == null)
  5412. throw new ArgumentNullException(nameof(source));
  5413. if (selector == null)
  5414. throw new ArgumentNullException(nameof(selector));
  5415. #if CRIPPLED_REFLECTION
  5416. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5417. #else
  5418. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5419. #endif
  5420. }
  5421. public static Task<double> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken)
  5422. {
  5423. if (source == null)
  5424. throw new ArgumentNullException(nameof(source));
  5425. if (selector == null)
  5426. throw new ArgumentNullException(nameof(selector));
  5427. #if CRIPPLED_REFLECTION
  5428. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, double>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5429. #else
  5430. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5431. #endif
  5432. }
  5433. public static Task<float?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken cancellationToken)
  5434. {
  5435. if (source == null)
  5436. throw new ArgumentNullException(nameof(source));
  5437. if (selector == null)
  5438. throw new ArgumentNullException(nameof(selector));
  5439. #if CRIPPLED_REFLECTION
  5440. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5441. #else
  5442. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5443. #endif
  5444. }
  5445. public static Task<float> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken)
  5446. {
  5447. if (source == null)
  5448. throw new ArgumentNullException(nameof(source));
  5449. if (selector == null)
  5450. throw new ArgumentNullException(nameof(selector));
  5451. #if CRIPPLED_REFLECTION
  5452. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, float>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5453. #else
  5454. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5455. #endif
  5456. }
  5457. public static Task<int?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken cancellationToken)
  5458. {
  5459. if (source == null)
  5460. throw new ArgumentNullException(nameof(source));
  5461. if (selector == null)
  5462. throw new ArgumentNullException(nameof(selector));
  5463. #if CRIPPLED_REFLECTION
  5464. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5465. #else
  5466. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5467. #endif
  5468. }
  5469. public static Task<int> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken)
  5470. {
  5471. if (source == null)
  5472. throw new ArgumentNullException(nameof(source));
  5473. if (selector == null)
  5474. throw new ArgumentNullException(nameof(selector));
  5475. #if CRIPPLED_REFLECTION
  5476. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5477. #else
  5478. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5479. #endif
  5480. }
  5481. public static Task<long?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken cancellationToken)
  5482. {
  5483. if (source == null)
  5484. throw new ArgumentNullException(nameof(source));
  5485. if (selector == null)
  5486. throw new ArgumentNullException(nameof(selector));
  5487. #if CRIPPLED_REFLECTION
  5488. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long?>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5489. #else
  5490. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5491. #endif
  5492. }
  5493. public static Task<long> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken)
  5494. {
  5495. if (source == null)
  5496. throw new ArgumentNullException(nameof(source));
  5497. if (selector == null)
  5498. throw new ArgumentNullException(nameof(selector));
  5499. #if CRIPPLED_REFLECTION
  5500. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, long>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5501. #else
  5502. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5503. #endif
  5504. }
  5505. public static Task<decimal?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal?>>> selector, CancellationToken cancellationToken)
  5506. {
  5507. if (source == null)
  5508. throw new ArgumentNullException(nameof(source));
  5509. if (selector == null)
  5510. throw new ArgumentNullException(nameof(selector));
  5511. #if CRIPPLED_REFLECTION
  5512. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5513. #else
  5514. return source.Provider.ExecuteAsync<decimal?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5515. #endif
  5516. }
  5517. public static Task<decimal> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<decimal>>> selector, CancellationToken cancellationToken)
  5518. {
  5519. if (source == null)
  5520. throw new ArgumentNullException(nameof(source));
  5521. if (selector == null)
  5522. throw new ArgumentNullException(nameof(selector));
  5523. #if CRIPPLED_REFLECTION
  5524. return source.Provider.ExecuteAsync<decimal>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<decimal>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5525. #else
  5526. return source.Provider.ExecuteAsync<decimal>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5527. #endif
  5528. }
  5529. public static Task<double?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double?>>> selector, CancellationToken cancellationToken)
  5530. {
  5531. if (source == null)
  5532. throw new ArgumentNullException(nameof(source));
  5533. if (selector == null)
  5534. throw new ArgumentNullException(nameof(selector));
  5535. #if CRIPPLED_REFLECTION
  5536. return source.Provider.ExecuteAsync<double?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5537. #else
  5538. return source.Provider.ExecuteAsync<double?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5539. #endif
  5540. }
  5541. public static Task<double> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<double>>> selector, CancellationToken cancellationToken)
  5542. {
  5543. if (source == null)
  5544. throw new ArgumentNullException(nameof(source));
  5545. if (selector == null)
  5546. throw new ArgumentNullException(nameof(selector));
  5547. #if CRIPPLED_REFLECTION
  5548. return source.Provider.ExecuteAsync<double>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<double>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5549. #else
  5550. return source.Provider.ExecuteAsync<double>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5551. #endif
  5552. }
  5553. public static Task<float?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float?>>> selector, CancellationToken cancellationToken)
  5554. {
  5555. if (source == null)
  5556. throw new ArgumentNullException(nameof(source));
  5557. if (selector == null)
  5558. throw new ArgumentNullException(nameof(selector));
  5559. #if CRIPPLED_REFLECTION
  5560. return source.Provider.ExecuteAsync<float?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5561. #else
  5562. return source.Provider.ExecuteAsync<float?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5563. #endif
  5564. }
  5565. public static Task<float> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<float>>> selector, CancellationToken cancellationToken)
  5566. {
  5567. if (source == null)
  5568. throw new ArgumentNullException(nameof(source));
  5569. if (selector == null)
  5570. throw new ArgumentNullException(nameof(selector));
  5571. #if CRIPPLED_REFLECTION
  5572. return source.Provider.ExecuteAsync<float>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<float>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5573. #else
  5574. return source.Provider.ExecuteAsync<float>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5575. #endif
  5576. }
  5577. public static Task<int?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int?>>> selector, CancellationToken cancellationToken)
  5578. {
  5579. if (source == null)
  5580. throw new ArgumentNullException(nameof(source));
  5581. if (selector == null)
  5582. throw new ArgumentNullException(nameof(selector));
  5583. #if CRIPPLED_REFLECTION
  5584. return source.Provider.ExecuteAsync<int?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5585. #else
  5586. return source.Provider.ExecuteAsync<int?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5587. #endif
  5588. }
  5589. public static Task<int> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<int>>> selector, CancellationToken cancellationToken)
  5590. {
  5591. if (source == null)
  5592. throw new ArgumentNullException(nameof(source));
  5593. if (selector == null)
  5594. throw new ArgumentNullException(nameof(selector));
  5595. #if CRIPPLED_REFLECTION
  5596. return source.Provider.ExecuteAsync<int>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<int>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5597. #else
  5598. return source.Provider.ExecuteAsync<int>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5599. #endif
  5600. }
  5601. public static Task<long?> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long?>>> selector, CancellationToken cancellationToken)
  5602. {
  5603. if (source == null)
  5604. throw new ArgumentNullException(nameof(source));
  5605. if (selector == null)
  5606. throw new ArgumentNullException(nameof(selector));
  5607. #if CRIPPLED_REFLECTION
  5608. return source.Provider.ExecuteAsync<long?>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long?>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5609. #else
  5610. return source.Provider.ExecuteAsync<long?>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5611. #endif
  5612. }
  5613. public static Task<long> SumAsync<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<long>>> selector, CancellationToken cancellationToken)
  5614. {
  5615. if (source == null)
  5616. throw new ArgumentNullException(nameof(source));
  5617. if (selector == null)
  5618. throw new ArgumentNullException(nameof(selector));
  5619. #if CRIPPLED_REFLECTION
  5620. return source.Provider.ExecuteAsync<long>(Expression.Call(InfoOf(() => AsyncQueryable.SumAsync<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<long>>>), default(CancellationToken))), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5621. #else
  5622. return source.Provider.ExecuteAsync<long>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, selector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5623. #endif
  5624. }
  5625. public static IAsyncQueryable<TSource> Take<TSource>(this IAsyncQueryable<TSource> source, int count)
  5626. {
  5627. if (source == null)
  5628. throw new ArgumentNullException(nameof(source));
  5629. #if CRIPPLED_REFLECTION
  5630. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Take<TSource>(default(IAsyncQueryable<TSource>), default(int))), source.Expression, Expression.Constant(count, typeof(int))));
  5631. #else
  5632. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
  5633. #endif
  5634. }
  5635. public static IAsyncQueryable<TSource> TakeLast<TSource>(this IAsyncQueryable<TSource> source, int count)
  5636. {
  5637. if (source == null)
  5638. throw new ArgumentNullException(nameof(source));
  5639. #if CRIPPLED_REFLECTION
  5640. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.TakeLast<TSource>(default(IAsyncQueryable<TSource>), default(int))), source.Expression, Expression.Constant(count, typeof(int))));
  5641. #else
  5642. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(count, typeof(int))));
  5643. #endif
  5644. }
  5645. public static IAsyncQueryable<TSource> TakeWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  5646. {
  5647. if (source == null)
  5648. throw new ArgumentNullException(nameof(source));
  5649. if (predicate == null)
  5650. throw new ArgumentNullException(nameof(predicate));
  5651. #if CRIPPLED_REFLECTION
  5652. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.TakeWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate));
  5653. #else
  5654. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  5655. #endif
  5656. }
  5657. public static IAsyncQueryable<TSource> TakeWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate)
  5658. {
  5659. if (source == null)
  5660. throw new ArgumentNullException(nameof(source));
  5661. if (predicate == null)
  5662. throw new ArgumentNullException(nameof(predicate));
  5663. #if CRIPPLED_REFLECTION
  5664. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.TakeWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>))), source.Expression, predicate));
  5665. #else
  5666. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  5667. #endif
  5668. }
  5669. public static IAsyncQueryable<TSource> TakeWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
  5670. {
  5671. if (source == null)
  5672. throw new ArgumentNullException(nameof(source));
  5673. if (predicate == null)
  5674. throw new ArgumentNullException(nameof(predicate));
  5675. #if CRIPPLED_REFLECTION
  5676. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.TakeWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, bool>>))), source.Expression, predicate));
  5677. #else
  5678. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  5679. #endif
  5680. }
  5681. public static IAsyncQueryable<TSource> TakeWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, CancellationToken, ValueTask<bool>>> predicate)
  5682. {
  5683. if (source == null)
  5684. throw new ArgumentNullException(nameof(source));
  5685. if (predicate == null)
  5686. throw new ArgumentNullException(nameof(predicate));
  5687. #if CRIPPLED_REFLECTION
  5688. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.TakeWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, CancellationToken, ValueTask<bool>>>))), source.Expression, predicate));
  5689. #else
  5690. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  5691. #endif
  5692. }
  5693. public static IAsyncQueryable<TSource> TakeWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, ValueTask<bool>>> predicate)
  5694. {
  5695. if (source == null)
  5696. throw new ArgumentNullException(nameof(source));
  5697. if (predicate == null)
  5698. throw new ArgumentNullException(nameof(predicate));
  5699. #if CRIPPLED_REFLECTION
  5700. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.TakeWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, ValueTask<bool>>>))), source.Expression, predicate));
  5701. #else
  5702. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  5703. #endif
  5704. }
  5705. public static IAsyncQueryable<TSource> TakeWhile<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  5706. {
  5707. if (source == null)
  5708. throw new ArgumentNullException(nameof(source));
  5709. if (predicate == null)
  5710. throw new ArgumentNullException(nameof(predicate));
  5711. #if CRIPPLED_REFLECTION
  5712. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.TakeWhile<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate));
  5713. #else
  5714. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  5715. #endif
  5716. }
  5717. public static IOrderedAsyncQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector)
  5718. {
  5719. if (source == null)
  5720. throw new ArgumentNullException(nameof(source));
  5721. if (keySelector == null)
  5722. throw new ArgumentNullException(nameof(keySelector));
  5723. #if CRIPPLED_REFLECTION
  5724. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenBy<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>))), source.Expression, keySelector));
  5725. #else
  5726. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  5727. #endif
  5728. }
  5729. public static IOrderedAsyncQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  5730. {
  5731. if (source == null)
  5732. throw new ArgumentNullException(nameof(source));
  5733. if (keySelector == null)
  5734. throw new ArgumentNullException(nameof(keySelector));
  5735. #if CRIPPLED_REFLECTION
  5736. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenBy<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>))), source.Expression, keySelector));
  5737. #else
  5738. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  5739. #endif
  5740. }
  5741. public static IOrderedAsyncQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector)
  5742. {
  5743. if (source == null)
  5744. throw new ArgumentNullException(nameof(source));
  5745. if (keySelector == null)
  5746. throw new ArgumentNullException(nameof(keySelector));
  5747. #if CRIPPLED_REFLECTION
  5748. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenBy<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>))), source.Expression, keySelector));
  5749. #else
  5750. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  5751. #endif
  5752. }
  5753. public static IOrderedAsyncQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer)
  5754. {
  5755. if (source == null)
  5756. throw new ArgumentNullException(nameof(source));
  5757. if (keySelector == null)
  5758. throw new ArgumentNullException(nameof(keySelector));
  5759. #if CRIPPLED_REFLECTION
  5760. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenBy<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5761. #else
  5762. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5763. #endif
  5764. }
  5765. public static IOrderedAsyncQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
  5766. {
  5767. if (source == null)
  5768. throw new ArgumentNullException(nameof(source));
  5769. if (keySelector == null)
  5770. throw new ArgumentNullException(nameof(keySelector));
  5771. #if CRIPPLED_REFLECTION
  5772. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenBy<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5773. #else
  5774. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5775. #endif
  5776. }
  5777. public static IOrderedAsyncQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer)
  5778. {
  5779. if (source == null)
  5780. throw new ArgumentNullException(nameof(source));
  5781. if (keySelector == null)
  5782. throw new ArgumentNullException(nameof(keySelector));
  5783. #if CRIPPLED_REFLECTION
  5784. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenBy<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5785. #else
  5786. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5787. #endif
  5788. }
  5789. public static IOrderedAsyncQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector)
  5790. {
  5791. if (source == null)
  5792. throw new ArgumentNullException(nameof(source));
  5793. if (keySelector == null)
  5794. throw new ArgumentNullException(nameof(keySelector));
  5795. #if CRIPPLED_REFLECTION
  5796. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenByDescending<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>))), source.Expression, keySelector));
  5797. #else
  5798. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  5799. #endif
  5800. }
  5801. public static IOrderedAsyncQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  5802. {
  5803. if (source == null)
  5804. throw new ArgumentNullException(nameof(source));
  5805. if (keySelector == null)
  5806. throw new ArgumentNullException(nameof(keySelector));
  5807. #if CRIPPLED_REFLECTION
  5808. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenByDescending<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>))), source.Expression, keySelector));
  5809. #else
  5810. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  5811. #endif
  5812. }
  5813. public static IOrderedAsyncQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector)
  5814. {
  5815. if (source == null)
  5816. throw new ArgumentNullException(nameof(source));
  5817. if (keySelector == null)
  5818. throw new ArgumentNullException(nameof(keySelector));
  5819. #if CRIPPLED_REFLECTION
  5820. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenByDescending<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>))), source.Expression, keySelector));
  5821. #else
  5822. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector));
  5823. #endif
  5824. }
  5825. public static IOrderedAsyncQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer)
  5826. {
  5827. if (source == null)
  5828. throw new ArgumentNullException(nameof(source));
  5829. if (keySelector == null)
  5830. throw new ArgumentNullException(nameof(keySelector));
  5831. #if CRIPPLED_REFLECTION
  5832. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenByDescending<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5833. #else
  5834. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5835. #endif
  5836. }
  5837. public static IOrderedAsyncQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey> comparer)
  5838. {
  5839. if (source == null)
  5840. throw new ArgumentNullException(nameof(source));
  5841. if (keySelector == null)
  5842. throw new ArgumentNullException(nameof(keySelector));
  5843. #if CRIPPLED_REFLECTION
  5844. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenByDescending<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5845. #else
  5846. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5847. #endif
  5848. }
  5849. public static IOrderedAsyncQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IComparer<TKey> comparer)
  5850. {
  5851. if (source == null)
  5852. throw new ArgumentNullException(nameof(source));
  5853. if (keySelector == null)
  5854. throw new ArgumentNullException(nameof(keySelector));
  5855. #if CRIPPLED_REFLECTION
  5856. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.ThenByDescending<TSource, TKey>(default(IOrderedAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5857. #else
  5858. return (IOrderedAsyncQueryable<TSource>)source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IComparer<TKey>))));
  5859. #endif
  5860. }
  5861. public static Task<TSource[]> ToArrayAsync<TSource>(this IAsyncQueryable<TSource> source)
  5862. {
  5863. if (source == null)
  5864. throw new ArgumentNullException(nameof(source));
  5865. #if CRIPPLED_REFLECTION
  5866. return source.Provider.ExecuteAsync<TSource[]>(Expression.Call(InfoOf(() => AsyncQueryable.ToArrayAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  5867. #else
  5868. return source.Provider.ExecuteAsync<TSource[]>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  5869. #endif
  5870. }
  5871. public static Task<TSource[]> ToArrayAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  5872. {
  5873. if (source == null)
  5874. throw new ArgumentNullException(nameof(source));
  5875. #if CRIPPLED_REFLECTION
  5876. return source.Provider.ExecuteAsync<TSource[]>(Expression.Call(InfoOf(() => AsyncQueryable.ToArrayAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5877. #else
  5878. return source.Provider.ExecuteAsync<TSource[]>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5879. #endif
  5880. }
  5881. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  5882. {
  5883. if (source == null)
  5884. throw new ArgumentNullException(nameof(source));
  5885. if (keySelector == null)
  5886. throw new ArgumentNullException(nameof(keySelector));
  5887. #if CRIPPLED_REFLECTION
  5888. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>))), source.Expression, keySelector), CancellationToken.None);
  5889. #else
  5890. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None);
  5891. #endif
  5892. }
  5893. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector)
  5894. {
  5895. if (source == null)
  5896. throw new ArgumentNullException(nameof(source));
  5897. if (keySelector == null)
  5898. throw new ArgumentNullException(nameof(keySelector));
  5899. #if CRIPPLED_REFLECTION
  5900. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>))), source.Expression, keySelector), CancellationToken.None);
  5901. #else
  5902. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None);
  5903. #endif
  5904. }
  5905. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, CancellationToken cancellationToken)
  5906. {
  5907. if (source == null)
  5908. throw new ArgumentNullException(nameof(source));
  5909. if (keySelector == null)
  5910. throw new ArgumentNullException(nameof(keySelector));
  5911. #if CRIPPLED_REFLECTION
  5912. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5913. #else
  5914. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5915. #endif
  5916. }
  5917. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, CancellationToken cancellationToken)
  5918. {
  5919. if (source == null)
  5920. throw new ArgumentNullException(nameof(source));
  5921. if (keySelector == null)
  5922. throw new ArgumentNullException(nameof(keySelector));
  5923. #if CRIPPLED_REFLECTION
  5924. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5925. #else
  5926. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5927. #endif
  5928. }
  5929. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
  5930. {
  5931. if (source == null)
  5932. throw new ArgumentNullException(nameof(source));
  5933. if (keySelector == null)
  5934. throw new ArgumentNullException(nameof(keySelector));
  5935. #if CRIPPLED_REFLECTION
  5936. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  5937. #else
  5938. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  5939. #endif
  5940. }
  5941. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, CancellationToken cancellationToken)
  5942. {
  5943. if (source == null)
  5944. throw new ArgumentNullException(nameof(source));
  5945. if (keySelector == null)
  5946. throw new ArgumentNullException(nameof(keySelector));
  5947. #if CRIPPLED_REFLECTION
  5948. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5949. #else
  5950. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5951. #endif
  5952. }
  5953. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer)
  5954. {
  5955. if (source == null)
  5956. throw new ArgumentNullException(nameof(source));
  5957. if (keySelector == null)
  5958. throw new ArgumentNullException(nameof(keySelector));
  5959. #if CRIPPLED_REFLECTION
  5960. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  5961. #else
  5962. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  5963. #endif
  5964. }
  5965. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  5966. {
  5967. if (source == null)
  5968. throw new ArgumentNullException(nameof(source));
  5969. if (keySelector == null)
  5970. throw new ArgumentNullException(nameof(keySelector));
  5971. #if CRIPPLED_REFLECTION
  5972. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5973. #else
  5974. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5975. #endif
  5976. }
  5977. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  5978. {
  5979. if (source == null)
  5980. throw new ArgumentNullException(nameof(source));
  5981. if (keySelector == null)
  5982. throw new ArgumentNullException(nameof(keySelector));
  5983. #if CRIPPLED_REFLECTION
  5984. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5985. #else
  5986. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5987. #endif
  5988. }
  5989. public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  5990. {
  5991. if (source == null)
  5992. throw new ArgumentNullException(nameof(source));
  5993. if (keySelector == null)
  5994. throw new ArgumentNullException(nameof(keySelector));
  5995. #if CRIPPLED_REFLECTION
  5996. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5997. #else
  5998. return source.Provider.ExecuteAsync<Dictionary<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  5999. #endif
  6000. }
  6001. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
  6002. {
  6003. if (source == null)
  6004. throw new ArgumentNullException(nameof(source));
  6005. if (keySelector == null)
  6006. throw new ArgumentNullException(nameof(keySelector));
  6007. if (elementSelector == null)
  6008. throw new ArgumentNullException(nameof(elementSelector));
  6009. #if CRIPPLED_REFLECTION
  6010. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>))), source.Expression, keySelector, elementSelector), CancellationToken.None);
  6011. #else
  6012. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector), CancellationToken.None);
  6013. #endif
  6014. }
  6015. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector)
  6016. {
  6017. if (source == null)
  6018. throw new ArgumentNullException(nameof(source));
  6019. if (keySelector == null)
  6020. throw new ArgumentNullException(nameof(keySelector));
  6021. if (elementSelector == null)
  6022. throw new ArgumentNullException(nameof(elementSelector));
  6023. #if CRIPPLED_REFLECTION
  6024. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>))), source.Expression, keySelector, elementSelector), CancellationToken.None);
  6025. #else
  6026. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector), CancellationToken.None);
  6027. #endif
  6028. }
  6029. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TSource, CancellationToken, ValueTask<TElement>>> elementSelector, CancellationToken cancellationToken)
  6030. {
  6031. if (source == null)
  6032. throw new ArgumentNullException(nameof(source));
  6033. if (keySelector == null)
  6034. throw new ArgumentNullException(nameof(keySelector));
  6035. if (elementSelector == null)
  6036. throw new ArgumentNullException(nameof(elementSelector));
  6037. #if CRIPPLED_REFLECTION
  6038. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TSource, CancellationToken, ValueTask<TElement>>>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6039. #else
  6040. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6041. #endif
  6042. }
  6043. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, CancellationToken cancellationToken)
  6044. {
  6045. if (source == null)
  6046. throw new ArgumentNullException(nameof(source));
  6047. if (keySelector == null)
  6048. throw new ArgumentNullException(nameof(keySelector));
  6049. if (elementSelector == null)
  6050. throw new ArgumentNullException(nameof(elementSelector));
  6051. #if CRIPPLED_REFLECTION
  6052. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6053. #else
  6054. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6055. #endif
  6056. }
  6057. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer)
  6058. {
  6059. if (source == null)
  6060. throw new ArgumentNullException(nameof(source));
  6061. if (keySelector == null)
  6062. throw new ArgumentNullException(nameof(keySelector));
  6063. if (elementSelector == null)
  6064. throw new ArgumentNullException(nameof(elementSelector));
  6065. #if CRIPPLED_REFLECTION
  6066. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6067. #else
  6068. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6069. #endif
  6070. }
  6071. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, CancellationToken cancellationToken)
  6072. {
  6073. if (source == null)
  6074. throw new ArgumentNullException(nameof(source));
  6075. if (keySelector == null)
  6076. throw new ArgumentNullException(nameof(keySelector));
  6077. if (elementSelector == null)
  6078. throw new ArgumentNullException(nameof(elementSelector));
  6079. #if CRIPPLED_REFLECTION
  6080. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6081. #else
  6082. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6083. #endif
  6084. }
  6085. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, IEqualityComparer<TKey> comparer)
  6086. {
  6087. if (source == null)
  6088. throw new ArgumentNullException(nameof(source));
  6089. if (keySelector == null)
  6090. throw new ArgumentNullException(nameof(keySelector));
  6091. if (elementSelector == null)
  6092. throw new ArgumentNullException(nameof(elementSelector));
  6093. #if CRIPPLED_REFLECTION
  6094. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6095. #else
  6096. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6097. #endif
  6098. }
  6099. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TSource, CancellationToken, ValueTask<TElement>>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6100. {
  6101. if (source == null)
  6102. throw new ArgumentNullException(nameof(source));
  6103. if (keySelector == null)
  6104. throw new ArgumentNullException(nameof(keySelector));
  6105. if (elementSelector == null)
  6106. throw new ArgumentNullException(nameof(elementSelector));
  6107. #if CRIPPLED_REFLECTION
  6108. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TSource, CancellationToken, ValueTask<TElement>>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6109. #else
  6110. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6111. #endif
  6112. }
  6113. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6114. {
  6115. if (source == null)
  6116. throw new ArgumentNullException(nameof(source));
  6117. if (keySelector == null)
  6118. throw new ArgumentNullException(nameof(keySelector));
  6119. if (elementSelector == null)
  6120. throw new ArgumentNullException(nameof(elementSelector));
  6121. #if CRIPPLED_REFLECTION
  6122. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6123. #else
  6124. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6125. #endif
  6126. }
  6127. public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6128. {
  6129. if (source == null)
  6130. throw new ArgumentNullException(nameof(source));
  6131. if (keySelector == null)
  6132. throw new ArgumentNullException(nameof(keySelector));
  6133. if (elementSelector == null)
  6134. throw new ArgumentNullException(nameof(elementSelector));
  6135. #if CRIPPLED_REFLECTION
  6136. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToDictionaryAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6137. #else
  6138. return source.Provider.ExecuteAsync<Dictionary<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6139. #endif
  6140. }
  6141. public static Task<HashSet<TSource>> ToHashSetAsync<TSource>(this IAsyncQueryable<TSource> source)
  6142. {
  6143. if (source == null)
  6144. throw new ArgumentNullException(nameof(source));
  6145. #if CRIPPLED_REFLECTION
  6146. return source.Provider.ExecuteAsync<HashSet<TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToHashSetAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  6147. #else
  6148. return source.Provider.ExecuteAsync<HashSet<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  6149. #endif
  6150. }
  6151. public static Task<HashSet<TSource>> ToHashSetAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  6152. {
  6153. if (source == null)
  6154. throw new ArgumentNullException(nameof(source));
  6155. #if CRIPPLED_REFLECTION
  6156. return source.Provider.ExecuteAsync<HashSet<TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToHashSetAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6157. #else
  6158. return source.Provider.ExecuteAsync<HashSet<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6159. #endif
  6160. }
  6161. public static Task<HashSet<TSource>> ToHashSetAsync<TSource>(this IAsyncQueryable<TSource> source, IEqualityComparer<TSource> comparer)
  6162. {
  6163. if (source == null)
  6164. throw new ArgumentNullException(nameof(source));
  6165. #if CRIPPLED_REFLECTION
  6166. return source.Provider.ExecuteAsync<HashSet<TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToHashSetAsync<TSource>(default(IAsyncQueryable<TSource>), default(IEqualityComparer<TSource>))), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))), CancellationToken.None);
  6167. #else
  6168. return source.Provider.ExecuteAsync<HashSet<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))), CancellationToken.None);
  6169. #endif
  6170. }
  6171. public static Task<HashSet<TSource>> ToHashSetAsync<TSource>(this IAsyncQueryable<TSource> source, IEqualityComparer<TSource> comparer, CancellationToken cancellationToken)
  6172. {
  6173. if (source == null)
  6174. throw new ArgumentNullException(nameof(source));
  6175. #if CRIPPLED_REFLECTION
  6176. return source.Provider.ExecuteAsync<HashSet<TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToHashSetAsync<TSource>(default(IAsyncQueryable<TSource>), default(IEqualityComparer<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6177. #else
  6178. return source.Provider.ExecuteAsync<HashSet<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6179. #endif
  6180. }
  6181. public static Task<List<TSource>> ToListAsync<TSource>(this IAsyncQueryable<TSource> source)
  6182. {
  6183. if (source == null)
  6184. throw new ArgumentNullException(nameof(source));
  6185. #if CRIPPLED_REFLECTION
  6186. return source.Provider.ExecuteAsync<List<TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToListAsync<TSource>(default(IAsyncQueryable<TSource>))), source.Expression), CancellationToken.None);
  6187. #else
  6188. return source.Provider.ExecuteAsync<List<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression), CancellationToken.None);
  6189. #endif
  6190. }
  6191. public static Task<List<TSource>> ToListAsync<TSource>(this IAsyncQueryable<TSource> source, CancellationToken cancellationToken)
  6192. {
  6193. if (source == null)
  6194. throw new ArgumentNullException(nameof(source));
  6195. #if CRIPPLED_REFLECTION
  6196. return source.Provider.ExecuteAsync<List<TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToListAsync<TSource>(default(IAsyncQueryable<TSource>), default(CancellationToken))), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6197. #else
  6198. return source.Provider.ExecuteAsync<List<TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6199. #endif
  6200. }
  6201. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)
  6202. {
  6203. if (source == null)
  6204. throw new ArgumentNullException(nameof(source));
  6205. if (keySelector == null)
  6206. throw new ArgumentNullException(nameof(keySelector));
  6207. #if CRIPPLED_REFLECTION
  6208. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>))), source.Expression, keySelector), CancellationToken.None);
  6209. #else
  6210. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None);
  6211. #endif
  6212. }
  6213. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector)
  6214. {
  6215. if (source == null)
  6216. throw new ArgumentNullException(nameof(source));
  6217. if (keySelector == null)
  6218. throw new ArgumentNullException(nameof(keySelector));
  6219. #if CRIPPLED_REFLECTION
  6220. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>))), source.Expression, keySelector), CancellationToken.None);
  6221. #else
  6222. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector), CancellationToken.None);
  6223. #endif
  6224. }
  6225. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, CancellationToken cancellationToken)
  6226. {
  6227. if (source == null)
  6228. throw new ArgumentNullException(nameof(source));
  6229. if (keySelector == null)
  6230. throw new ArgumentNullException(nameof(keySelector));
  6231. #if CRIPPLED_REFLECTION
  6232. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6233. #else
  6234. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6235. #endif
  6236. }
  6237. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, CancellationToken cancellationToken)
  6238. {
  6239. if (source == null)
  6240. throw new ArgumentNullException(nameof(source));
  6241. if (keySelector == null)
  6242. throw new ArgumentNullException(nameof(keySelector));
  6243. #if CRIPPLED_REFLECTION
  6244. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6245. #else
  6246. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6247. #endif
  6248. }
  6249. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer)
  6250. {
  6251. if (source == null)
  6252. throw new ArgumentNullException(nameof(source));
  6253. if (keySelector == null)
  6254. throw new ArgumentNullException(nameof(keySelector));
  6255. #if CRIPPLED_REFLECTION
  6256. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6257. #else
  6258. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6259. #endif
  6260. }
  6261. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, CancellationToken cancellationToken)
  6262. {
  6263. if (source == null)
  6264. throw new ArgumentNullException(nameof(source));
  6265. if (keySelector == null)
  6266. throw new ArgumentNullException(nameof(keySelector));
  6267. #if CRIPPLED_REFLECTION
  6268. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6269. #else
  6270. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6271. #endif
  6272. }
  6273. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer)
  6274. {
  6275. if (source == null)
  6276. throw new ArgumentNullException(nameof(source));
  6277. if (keySelector == null)
  6278. throw new ArgumentNullException(nameof(keySelector));
  6279. #if CRIPPLED_REFLECTION
  6280. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6281. #else
  6282. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6283. #endif
  6284. }
  6285. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6286. {
  6287. if (source == null)
  6288. throw new ArgumentNullException(nameof(source));
  6289. if (keySelector == null)
  6290. throw new ArgumentNullException(nameof(keySelector));
  6291. #if CRIPPLED_REFLECTION
  6292. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6293. #else
  6294. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6295. #endif
  6296. }
  6297. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6298. {
  6299. if (source == null)
  6300. throw new ArgumentNullException(nameof(source));
  6301. if (keySelector == null)
  6302. throw new ArgumentNullException(nameof(keySelector));
  6303. #if CRIPPLED_REFLECTION
  6304. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6305. #else
  6306. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6307. #endif
  6308. }
  6309. public static Task<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6310. {
  6311. if (source == null)
  6312. throw new ArgumentNullException(nameof(source));
  6313. if (keySelector == null)
  6314. throw new ArgumentNullException(nameof(keySelector));
  6315. #if CRIPPLED_REFLECTION
  6316. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6317. #else
  6318. return source.Provider.ExecuteAsync<ILookup<TKey, TSource>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), source.Expression, keySelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6319. #endif
  6320. }
  6321. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector)
  6322. {
  6323. if (source == null)
  6324. throw new ArgumentNullException(nameof(source));
  6325. if (keySelector == null)
  6326. throw new ArgumentNullException(nameof(keySelector));
  6327. if (elementSelector == null)
  6328. throw new ArgumentNullException(nameof(elementSelector));
  6329. #if CRIPPLED_REFLECTION
  6330. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>))), source.Expression, keySelector, elementSelector), CancellationToken.None);
  6331. #else
  6332. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector), CancellationToken.None);
  6333. #endif
  6334. }
  6335. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector)
  6336. {
  6337. if (source == null)
  6338. throw new ArgumentNullException(nameof(source));
  6339. if (keySelector == null)
  6340. throw new ArgumentNullException(nameof(keySelector));
  6341. if (elementSelector == null)
  6342. throw new ArgumentNullException(nameof(elementSelector));
  6343. #if CRIPPLED_REFLECTION
  6344. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>))), source.Expression, keySelector, elementSelector), CancellationToken.None);
  6345. #else
  6346. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector), CancellationToken.None);
  6347. #endif
  6348. }
  6349. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TSource, CancellationToken, ValueTask<TElement>>> elementSelector, CancellationToken cancellationToken)
  6350. {
  6351. if (source == null)
  6352. throw new ArgumentNullException(nameof(source));
  6353. if (keySelector == null)
  6354. throw new ArgumentNullException(nameof(keySelector));
  6355. if (elementSelector == null)
  6356. throw new ArgumentNullException(nameof(elementSelector));
  6357. #if CRIPPLED_REFLECTION
  6358. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TSource, CancellationToken, ValueTask<TElement>>>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6359. #else
  6360. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6361. #endif
  6362. }
  6363. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, CancellationToken cancellationToken)
  6364. {
  6365. if (source == null)
  6366. throw new ArgumentNullException(nameof(source));
  6367. if (keySelector == null)
  6368. throw new ArgumentNullException(nameof(keySelector));
  6369. if (elementSelector == null)
  6370. throw new ArgumentNullException(nameof(elementSelector));
  6371. #if CRIPPLED_REFLECTION
  6372. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6373. #else
  6374. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6375. #endif
  6376. }
  6377. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer)
  6378. {
  6379. if (source == null)
  6380. throw new ArgumentNullException(nameof(source));
  6381. if (keySelector == null)
  6382. throw new ArgumentNullException(nameof(keySelector));
  6383. if (elementSelector == null)
  6384. throw new ArgumentNullException(nameof(elementSelector));
  6385. #if CRIPPLED_REFLECTION
  6386. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6387. #else
  6388. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6389. #endif
  6390. }
  6391. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, CancellationToken cancellationToken)
  6392. {
  6393. if (source == null)
  6394. throw new ArgumentNullException(nameof(source));
  6395. if (keySelector == null)
  6396. throw new ArgumentNullException(nameof(keySelector));
  6397. if (elementSelector == null)
  6398. throw new ArgumentNullException(nameof(elementSelector));
  6399. #if CRIPPLED_REFLECTION
  6400. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6401. #else
  6402. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6403. #endif
  6404. }
  6405. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, IEqualityComparer<TKey> comparer)
  6406. {
  6407. if (source == null)
  6408. throw new ArgumentNullException(nameof(source));
  6409. if (keySelector == null)
  6410. throw new ArgumentNullException(nameof(keySelector));
  6411. if (elementSelector == null)
  6412. throw new ArgumentNullException(nameof(elementSelector));
  6413. #if CRIPPLED_REFLECTION
  6414. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(IEqualityComparer<TKey>))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6415. #else
  6416. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>))), CancellationToken.None);
  6417. #endif
  6418. }
  6419. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<TKey>>> keySelector, Expression<Func<TSource, CancellationToken, ValueTask<TElement>>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6420. {
  6421. if (source == null)
  6422. throw new ArgumentNullException(nameof(source));
  6423. if (keySelector == null)
  6424. throw new ArgumentNullException(nameof(keySelector));
  6425. if (elementSelector == null)
  6426. throw new ArgumentNullException(nameof(elementSelector));
  6427. #if CRIPPLED_REFLECTION
  6428. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<TKey>>>), default(Expression<Func<TSource, CancellationToken, ValueTask<TElement>>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6429. #else
  6430. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6431. #endif
  6432. }
  6433. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6434. {
  6435. if (source == null)
  6436. throw new ArgumentNullException(nameof(source));
  6437. if (keySelector == null)
  6438. throw new ArgumentNullException(nameof(keySelector));
  6439. if (elementSelector == null)
  6440. throw new ArgumentNullException(nameof(elementSelector));
  6441. #if CRIPPLED_REFLECTION
  6442. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, TKey>>), default(Expression<Func<TSource, TElement>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6443. #else
  6444. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6445. #endif
  6446. }
  6447. public static Task<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<TKey>>> keySelector, Expression<Func<TSource, ValueTask<TElement>>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken)
  6448. {
  6449. if (source == null)
  6450. throw new ArgumentNullException(nameof(source));
  6451. if (keySelector == null)
  6452. throw new ArgumentNullException(nameof(keySelector));
  6453. if (elementSelector == null)
  6454. throw new ArgumentNullException(nameof(elementSelector));
  6455. #if CRIPPLED_REFLECTION
  6456. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(InfoOf(() => AsyncQueryable.ToLookupAsync<TSource, TKey, TElement>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<TKey>>>), default(Expression<Func<TSource, ValueTask<TElement>>>), default(IEqualityComparer<TKey>), default(CancellationToken))), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6457. #else
  6458. return source.Provider.ExecuteAsync<ILookup<TKey, TElement>>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), source.Expression, keySelector, elementSelector, Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)), Expression.Constant(cancellationToken, typeof(CancellationToken))), cancellationToken);
  6459. #endif
  6460. }
  6461. public static IAsyncQueryable<TSource> Union<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second)
  6462. {
  6463. if (first == null)
  6464. throw new ArgumentNullException(nameof(first));
  6465. if (second == null)
  6466. throw new ArgumentNullException(nameof(second));
  6467. #if CRIPPLED_REFLECTION
  6468. return first.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Union<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>))), first.Expression, GetSourceExpression(second)));
  6469. #else
  6470. return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second)));
  6471. #endif
  6472. }
  6473. public static IAsyncQueryable<TSource> Union<TSource>(this IAsyncQueryable<TSource> first, IAsyncEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
  6474. {
  6475. if (first == null)
  6476. throw new ArgumentNullException(nameof(first));
  6477. if (second == null)
  6478. throw new ArgumentNullException(nameof(second));
  6479. #if CRIPPLED_REFLECTION
  6480. return first.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Union<TSource>(default(IAsyncQueryable<TSource>), default(IAsyncEnumerable<TSource>), default(IEqualityComparer<TSource>))), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  6481. #else
  6482. return first.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), first.Expression, GetSourceExpression(second), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>))));
  6483. #endif
  6484. }
  6485. public static IAsyncQueryable<TSource> Where<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, bool>> predicate)
  6486. {
  6487. if (source == null)
  6488. throw new ArgumentNullException(nameof(source));
  6489. if (predicate == null)
  6490. throw new ArgumentNullException(nameof(predicate));
  6491. #if CRIPPLED_REFLECTION
  6492. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Where<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, bool>>))), source.Expression, predicate));
  6493. #else
  6494. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  6495. #endif
  6496. }
  6497. public static IAsyncQueryable<TSource> Where<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, CancellationToken, ValueTask<bool>>> predicate)
  6498. {
  6499. if (source == null)
  6500. throw new ArgumentNullException(nameof(source));
  6501. if (predicate == null)
  6502. throw new ArgumentNullException(nameof(predicate));
  6503. #if CRIPPLED_REFLECTION
  6504. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Where<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, CancellationToken, ValueTask<bool>>>))), source.Expression, predicate));
  6505. #else
  6506. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  6507. #endif
  6508. }
  6509. public static IAsyncQueryable<TSource> Where<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, bool>> predicate)
  6510. {
  6511. if (source == null)
  6512. throw new ArgumentNullException(nameof(source));
  6513. if (predicate == null)
  6514. throw new ArgumentNullException(nameof(predicate));
  6515. #if CRIPPLED_REFLECTION
  6516. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Where<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, bool>>))), source.Expression, predicate));
  6517. #else
  6518. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  6519. #endif
  6520. }
  6521. public static IAsyncQueryable<TSource> Where<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, CancellationToken, ValueTask<bool>>> predicate)
  6522. {
  6523. if (source == null)
  6524. throw new ArgumentNullException(nameof(source));
  6525. if (predicate == null)
  6526. throw new ArgumentNullException(nameof(predicate));
  6527. #if CRIPPLED_REFLECTION
  6528. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Where<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, CancellationToken, ValueTask<bool>>>))), source.Expression, predicate));
  6529. #else
  6530. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  6531. #endif
  6532. }
  6533. public static IAsyncQueryable<TSource> Where<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, int, ValueTask<bool>>> predicate)
  6534. {
  6535. if (source == null)
  6536. throw new ArgumentNullException(nameof(source));
  6537. if (predicate == null)
  6538. throw new ArgumentNullException(nameof(predicate));
  6539. #if CRIPPLED_REFLECTION
  6540. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Where<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, int, ValueTask<bool>>>))), source.Expression, predicate));
  6541. #else
  6542. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  6543. #endif
  6544. }
  6545. public static IAsyncQueryable<TSource> Where<TSource>(this IAsyncQueryable<TSource> source, Expression<Func<TSource, ValueTask<bool>>> predicate)
  6546. {
  6547. if (source == null)
  6548. throw new ArgumentNullException(nameof(source));
  6549. if (predicate == null)
  6550. throw new ArgumentNullException(nameof(predicate));
  6551. #if CRIPPLED_REFLECTION
  6552. return source.Provider.CreateQuery<TSource>(Expression.Call(InfoOf(() => AsyncQueryable.Where<TSource>(default(IAsyncQueryable<TSource>), default(Expression<Func<TSource, ValueTask<bool>>>))), source.Expression, predicate));
  6553. #else
  6554. return source.Provider.CreateQuery<TSource>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), source.Expression, predicate));
  6555. #endif
  6556. }
  6557. public static IAsyncQueryable<TResult> Zip<TFirst, TSecond, TResult>(this IAsyncQueryable<TFirst> first, IAsyncEnumerable<TSecond> second, Expression<Func<TFirst, TSecond, CancellationToken, ValueTask<TResult>>> selector)
  6558. {
  6559. if (first == null)
  6560. throw new ArgumentNullException(nameof(first));
  6561. if (second == null)
  6562. throw new ArgumentNullException(nameof(second));
  6563. if (selector == null)
  6564. throw new ArgumentNullException(nameof(selector));
  6565. #if CRIPPLED_REFLECTION
  6566. return first.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Zip<TFirst, TSecond, TResult>(default(IAsyncQueryable<TFirst>), default(IAsyncEnumerable<TSecond>), default(Expression<Func<TFirst, TSecond, CancellationToken, ValueTask<TResult>>>))), first.Expression, GetSourceExpression(second), selector));
  6567. #else
  6568. return first.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond), typeof(TResult)), first.Expression, GetSourceExpression(second), selector));
  6569. #endif
  6570. }
  6571. public static IAsyncQueryable<TResult> Zip<TFirst, TSecond, TResult>(this IAsyncQueryable<TFirst> first, IAsyncEnumerable<TSecond> second, Expression<Func<TFirst, TSecond, TResult>> selector)
  6572. {
  6573. if (first == null)
  6574. throw new ArgumentNullException(nameof(first));
  6575. if (second == null)
  6576. throw new ArgumentNullException(nameof(second));
  6577. if (selector == null)
  6578. throw new ArgumentNullException(nameof(selector));
  6579. #if CRIPPLED_REFLECTION
  6580. return first.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Zip<TFirst, TSecond, TResult>(default(IAsyncQueryable<TFirst>), default(IAsyncEnumerable<TSecond>), default(Expression<Func<TFirst, TSecond, TResult>>))), first.Expression, GetSourceExpression(second), selector));
  6581. #else
  6582. return first.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond), typeof(TResult)), first.Expression, GetSourceExpression(second), selector));
  6583. #endif
  6584. }
  6585. public static IAsyncQueryable<TResult> Zip<TFirst, TSecond, TResult>(this IAsyncQueryable<TFirst> first, IAsyncEnumerable<TSecond> second, Expression<Func<TFirst, TSecond, ValueTask<TResult>>> selector)
  6586. {
  6587. if (first == null)
  6588. throw new ArgumentNullException(nameof(first));
  6589. if (second == null)
  6590. throw new ArgumentNullException(nameof(second));
  6591. if (selector == null)
  6592. throw new ArgumentNullException(nameof(selector));
  6593. #if CRIPPLED_REFLECTION
  6594. return first.Provider.CreateQuery<TResult>(Expression.Call(InfoOf(() => AsyncQueryable.Zip<TFirst, TSecond, TResult>(default(IAsyncQueryable<TFirst>), default(IAsyncEnumerable<TSecond>), default(Expression<Func<TFirst, TSecond, ValueTask<TResult>>>))), first.Expression, GetSourceExpression(second), selector));
  6595. #else
  6596. return first.Provider.CreateQuery<TResult>(Expression.Call(((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond), typeof(TResult)), first.Expression, GetSourceExpression(second), selector));
  6597. #endif
  6598. }
  6599. }
  6600. }