Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Dynamic Expressions.html 121KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279
  1. <html xmlns:v="urn:schemas-microsoft-com:vml"
  2. xmlns:o="urn:schemas-microsoft-com:office:office"
  3. xmlns:w="urn:schemas-microsoft-com:office:word"
  4. xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
  5. xmlns="http://www.w3.org/TR/REC-html40">
  6. <head>
  7. <meta http-equiv=Content-Type content="text/html; charset=windows-1252">
  8. <meta name=ProgId content=Word.Document>
  9. <meta name=Generator content="Microsoft Word 12">
  10. <meta name=Originator content="Microsoft Word 12">
  11. <link rel=File-List href="Dynamic%20Expressions_files/filelist.xml">
  12. <title>Dynamic Expression API</title>
  13. <link rel=themeData href="Dynamic%20Expressions_files/themedata.thmx">
  14. <link rel=colorSchemeMapping
  15. href="Dynamic%20Expressions_files/colorschememapping.xml">
  16. <!--[if gte mso 9]><xml>
  17. <w:WordDocument>
  18. <w:SpellingState>Clean</w:SpellingState>
  19. <w:GrammarState>Clean</w:GrammarState>
  20. <w:TrackMoves>false</w:TrackMoves>
  21. <w:TrackFormatting/>
  22. <w:ValidateAgainstSchemas/>
  23. <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  24. <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  25. <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  26. <w:DoNotPromoteQF/>
  27. <w:LidThemeOther>EN-US</w:LidThemeOther>
  28. <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
  29. <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
  30. <w:Compatibility>
  31. <w:BreakWrappedTables/>
  32. <w:SnapToGridInCell/>
  33. <w:WrapTextWithPunct/>
  34. <w:UseAsianBreakRules/>
  35. <w:DontGrowAutofit/>
  36. <w:SplitPgBreakAndParaMark/>
  37. <w:DontVertAlignCellWithSp/>
  38. <w:DontBreakConstrainedForcedTables/>
  39. <w:DontVertAlignInTxbx/>
  40. <w:Word11KerningPairs/>
  41. <w:CachedColBalance/>
  42. </w:Compatibility>
  43. <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
  44. <m:mathPr>
  45. <m:mathFont m:val="Cambria Math"/>
  46. <m:brkBin m:val="before"/>
  47. <m:brkBinSub m:val="--"/>
  48. <m:smallFrac m:val="off"/>
  49. <m:dispDef/>
  50. <m:lMargin m:val="0"/>
  51. <m:rMargin m:val="0"/>
  52. <m:defJc m:val="centerGroup"/>
  53. <m:wrapIndent m:val="1440"/>
  54. <m:intLim m:val="subSup"/>
  55. <m:naryLim m:val="undOvr"/>
  56. </m:mathPr></w:WordDocument>
  57. </xml><![endif]--><!--[if gte mso 9]><xml>
  58. <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  59. DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  60. LatentStyleCount="267">
  61. <w:LsdException Locked="false" Priority="0" SemiHidden="false"
  62. UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
  63. <w:LsdException Locked="false" Priority="9" SemiHidden="false"
  64. UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
  65. <w:LsdException Locked="false" Priority="9" SemiHidden="false"
  66. UnhideWhenUsed="false" QFormat="true" Name="heading 2"/>
  67. <w:LsdException Locked="false" Priority="9" SemiHidden="false"
  68. UnhideWhenUsed="false" QFormat="true" Name="heading 3"/>
  69. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
  70. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
  71. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
  72. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
  73. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
  74. <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
  75. <w:LsdException Locked="false" Priority="39" Name="toc 1"/>
  76. <w:LsdException Locked="false" Priority="39" Name="toc 2"/>
  77. <w:LsdException Locked="false" Priority="39" Name="toc 3"/>
  78. <w:LsdException Locked="false" Priority="39" Name="toc 4"/>
  79. <w:LsdException Locked="false" Priority="39" Name="toc 5"/>
  80. <w:LsdException Locked="false" Priority="39" Name="toc 6"/>
  81. <w:LsdException Locked="false" Priority="39" Name="toc 7"/>
  82. <w:LsdException Locked="false" Priority="39" Name="toc 8"/>
  83. <w:LsdException Locked="false" Priority="39" Name="toc 9"/>
  84. <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
  85. <w:LsdException Locked="false" Priority="10" SemiHidden="false"
  86. UnhideWhenUsed="false" QFormat="true" Name="Title"/>
  87. <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
  88. <w:LsdException Locked="false" Priority="11" SemiHidden="false"
  89. UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
  90. <w:LsdException Locked="false" Priority="22" SemiHidden="false"
  91. UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
  92. <w:LsdException Locked="false" Priority="20" SemiHidden="false"
  93. UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
  94. <w:LsdException Locked="false" Priority="59" SemiHidden="false"
  95. UnhideWhenUsed="false" Name="Table Grid"/>
  96. <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
  97. <w:LsdException Locked="false" Priority="1" SemiHidden="false"
  98. UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
  99. <w:LsdException Locked="false" Priority="60" SemiHidden="false"
  100. UnhideWhenUsed="false" Name="Light Shading"/>
  101. <w:LsdException Locked="false" Priority="61" SemiHidden="false"
  102. UnhideWhenUsed="false" Name="Light List"/>
  103. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
  104. UnhideWhenUsed="false" Name="Light Grid"/>
  105. <w:LsdException Locked="false" Priority="63" SemiHidden="false"
  106. UnhideWhenUsed="false" Name="Medium Shading 1"/>
  107. <w:LsdException Locked="false" Priority="64" SemiHidden="false"
  108. UnhideWhenUsed="false" Name="Medium Shading 2"/>
  109. <w:LsdException Locked="false" Priority="65" SemiHidden="false"
  110. UnhideWhenUsed="false" Name="Medium List 1"/>
  111. <w:LsdException Locked="false" Priority="66" SemiHidden="false"
  112. UnhideWhenUsed="false" Name="Medium List 2"/>
  113. <w:LsdException Locked="false" Priority="67" SemiHidden="false"
  114. UnhideWhenUsed="false" Name="Medium Grid 1"/>
  115. <w:LsdException Locked="false" Priority="68" SemiHidden="false"
  116. UnhideWhenUsed="false" Name="Medium Grid 2"/>
  117. <w:LsdException Locked="false" Priority="69" SemiHidden="false"
  118. UnhideWhenUsed="false" Name="Medium Grid 3"/>
  119. <w:LsdException Locked="false" Priority="70" SemiHidden="false"
  120. UnhideWhenUsed="false" Name="Dark List"/>
  121. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
  122. UnhideWhenUsed="false" Name="Colorful Shading"/>
  123. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
  124. UnhideWhenUsed="false" Name="Colorful List"/>
  125. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
  126. UnhideWhenUsed="false" Name="Colorful Grid"/>
  127. <w:LsdException Locked="false" Priority="60" SemiHidden="false"
  128. UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
  129. <w:LsdException Locked="false" Priority="61" SemiHidden="false"
  130. UnhideWhenUsed="false" Name="Light List Accent 1"/>
  131. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
  132. UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
  133. <w:LsdException Locked="false" Priority="63" SemiHidden="false"
  134. UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
  135. <w:LsdException Locked="false" Priority="64" SemiHidden="false"
  136. UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
  137. <w:LsdException Locked="false" Priority="65" SemiHidden="false"
  138. UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
  139. <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
  140. <w:LsdException Locked="false" Priority="34" SemiHidden="false"
  141. UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
  142. <w:LsdException Locked="false" Priority="29" SemiHidden="false"
  143. UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
  144. <w:LsdException Locked="false" Priority="30" SemiHidden="false"
  145. UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
  146. <w:LsdException Locked="false" Priority="66" SemiHidden="false"
  147. UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
  148. <w:LsdException Locked="false" Priority="67" SemiHidden="false"
  149. UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
  150. <w:LsdException Locked="false" Priority="68" SemiHidden="false"
  151. UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
  152. <w:LsdException Locked="false" Priority="69" SemiHidden="false"
  153. UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
  154. <w:LsdException Locked="false" Priority="70" SemiHidden="false"
  155. UnhideWhenUsed="false" Name="Dark List Accent 1"/>
  156. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
  157. UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
  158. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
  159. UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
  160. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
  161. UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
  162. <w:LsdException Locked="false" Priority="60" SemiHidden="false"
  163. UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
  164. <w:LsdException Locked="false" Priority="61" SemiHidden="false"
  165. UnhideWhenUsed="false" Name="Light List Accent 2"/>
  166. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
  167. UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
  168. <w:LsdException Locked="false" Priority="63" SemiHidden="false"
  169. UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
  170. <w:LsdException Locked="false" Priority="64" SemiHidden="false"
  171. UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
  172. <w:LsdException Locked="false" Priority="65" SemiHidden="false"
  173. UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
  174. <w:LsdException Locked="false" Priority="66" SemiHidden="false"
  175. UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
  176. <w:LsdException Locked="false" Priority="67" SemiHidden="false"
  177. UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
  178. <w:LsdException Locked="false" Priority="68" SemiHidden="false"
  179. UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
  180. <w:LsdException Locked="false" Priority="69" SemiHidden="false"
  181. UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
  182. <w:LsdException Locked="false" Priority="70" SemiHidden="false"
  183. UnhideWhenUsed="false" Name="Dark List Accent 2"/>
  184. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
  185. UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
  186. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
  187. UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
  188. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
  189. UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
  190. <w:LsdException Locked="false" Priority="60" SemiHidden="false"
  191. UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
  192. <w:LsdException Locked="false" Priority="61" SemiHidden="false"
  193. UnhideWhenUsed="false" Name="Light List Accent 3"/>
  194. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
  195. UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
  196. <w:LsdException Locked="false" Priority="63" SemiHidden="false"
  197. UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
  198. <w:LsdException Locked="false" Priority="64" SemiHidden="false"
  199. UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
  200. <w:LsdException Locked="false" Priority="65" SemiHidden="false"
  201. UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
  202. <w:LsdException Locked="false" Priority="66" SemiHidden="false"
  203. UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
  204. <w:LsdException Locked="false" Priority="67" SemiHidden="false"
  205. UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
  206. <w:LsdException Locked="false" Priority="68" SemiHidden="false"
  207. UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
  208. <w:LsdException Locked="false" Priority="69" SemiHidden="false"
  209. UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
  210. <w:LsdException Locked="false" Priority="70" SemiHidden="false"
  211. UnhideWhenUsed="false" Name="Dark List Accent 3"/>
  212. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
  213. UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
  214. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
  215. UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
  216. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
  217. UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
  218. <w:LsdException Locked="false" Priority="60" SemiHidden="false"
  219. UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
  220. <w:LsdException Locked="false" Priority="61" SemiHidden="false"
  221. UnhideWhenUsed="false" Name="Light List Accent 4"/>
  222. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
  223. UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
  224. <w:LsdException Locked="false" Priority="63" SemiHidden="false"
  225. UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
  226. <w:LsdException Locked="false" Priority="64" SemiHidden="false"
  227. UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
  228. <w:LsdException Locked="false" Priority="65" SemiHidden="false"
  229. UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
  230. <w:LsdException Locked="false" Priority="66" SemiHidden="false"
  231. UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
  232. <w:LsdException Locked="false" Priority="67" SemiHidden="false"
  233. UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
  234. <w:LsdException Locked="false" Priority="68" SemiHidden="false"
  235. UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
  236. <w:LsdException Locked="false" Priority="69" SemiHidden="false"
  237. UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
  238. <w:LsdException Locked="false" Priority="70" SemiHidden="false"
  239. UnhideWhenUsed="false" Name="Dark List Accent 4"/>
  240. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
  241. UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
  242. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
  243. UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
  244. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
  245. UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
  246. <w:LsdException Locked="false" Priority="60" SemiHidden="false"
  247. UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
  248. <w:LsdException Locked="false" Priority="61" SemiHidden="false"
  249. UnhideWhenUsed="false" Name="Light List Accent 5"/>
  250. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
  251. UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
  252. <w:LsdException Locked="false" Priority="63" SemiHidden="false"
  253. UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
  254. <w:LsdException Locked="false" Priority="64" SemiHidden="false"
  255. UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
  256. <w:LsdException Locked="false" Priority="65" SemiHidden="false"
  257. UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
  258. <w:LsdException Locked="false" Priority="66" SemiHidden="false"
  259. UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
  260. <w:LsdException Locked="false" Priority="67" SemiHidden="false"
  261. UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
  262. <w:LsdException Locked="false" Priority="68" SemiHidden="false"
  263. UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
  264. <w:LsdException Locked="false" Priority="69" SemiHidden="false"
  265. UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
  266. <w:LsdException Locked="false" Priority="70" SemiHidden="false"
  267. UnhideWhenUsed="false" Name="Dark List Accent 5"/>
  268. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
  269. UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
  270. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
  271. UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
  272. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
  273. UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
  274. <w:LsdException Locked="false" Priority="60" SemiHidden="false"
  275. UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
  276. <w:LsdException Locked="false" Priority="61" SemiHidden="false"
  277. UnhideWhenUsed="false" Name="Light List Accent 6"/>
  278. <w:LsdException Locked="false" Priority="62" SemiHidden="false"
  279. UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
  280. <w:LsdException Locked="false" Priority="63" SemiHidden="false"
  281. UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
  282. <w:LsdException Locked="false" Priority="64" SemiHidden="false"
  283. UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
  284. <w:LsdException Locked="false" Priority="65" SemiHidden="false"
  285. UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
  286. <w:LsdException Locked="false" Priority="66" SemiHidden="false"
  287. UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
  288. <w:LsdException Locked="false" Priority="67" SemiHidden="false"
  289. UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
  290. <w:LsdException Locked="false" Priority="68" SemiHidden="false"
  291. UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
  292. <w:LsdException Locked="false" Priority="69" SemiHidden="false"
  293. UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
  294. <w:LsdException Locked="false" Priority="70" SemiHidden="false"
  295. UnhideWhenUsed="false" Name="Dark List Accent 6"/>
  296. <w:LsdException Locked="false" Priority="71" SemiHidden="false"
  297. UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
  298. <w:LsdException Locked="false" Priority="72" SemiHidden="false"
  299. UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
  300. <w:LsdException Locked="false" Priority="73" SemiHidden="false"
  301. UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
  302. <w:LsdException Locked="false" Priority="19" SemiHidden="false"
  303. UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
  304. <w:LsdException Locked="false" Priority="21" SemiHidden="false"
  305. UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
  306. <w:LsdException Locked="false" Priority="31" SemiHidden="false"
  307. UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
  308. <w:LsdException Locked="false" Priority="32" SemiHidden="false"
  309. UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
  310. <w:LsdException Locked="false" Priority="33" SemiHidden="false"
  311. UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
  312. <w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
  313. <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
  314. </w:LatentStyles>
  315. </xml><![endif]-->
  316. <style>
  317. <!--
  318. /* Font Definitions */
  319. @font-face
  320. {font-family:"Cambria Math";
  321. panose-1:2 4 5 3 5 4 6 3 2 4;
  322. mso-font-charset:1;
  323. mso-generic-font-family:roman;
  324. mso-font-format:other;
  325. mso-font-pitch:variable;
  326. mso-font-signature:0 0 0 0 0 0;}
  327. @font-face
  328. {font-family:Cambria;
  329. panose-1:2 4 5 3 5 4 6 3 2 4;
  330. mso-font-charset:0;
  331. mso-generic-font-family:roman;
  332. mso-font-pitch:variable;
  333. mso-font-signature:-1610611985 1073741899 0 0 159 0;}
  334. @font-face
  335. {font-family:Calibri;
  336. panose-1:2 15 5 2 2 2 4 3 2 4;
  337. mso-font-charset:0;
  338. mso-generic-font-family:swiss;
  339. mso-font-pitch:variable;
  340. mso-font-signature:-1610611985 1073750139 0 0 159 0;}
  341. @font-face
  342. {font-family:Tahoma;
  343. panose-1:2 11 6 4 3 5 4 4 2 4;
  344. mso-font-charset:0;
  345. mso-generic-font-family:swiss;
  346. mso-font-pitch:variable;
  347. mso-font-signature:-520082689 -1073717157 41 0 66047 0;}
  348. @font-face
  349. {font-family:Consolas;
  350. panose-1:2 11 6 9 2 2 4 3 2 4;
  351. mso-font-charset:0;
  352. mso-generic-font-family:modern;
  353. mso-font-pitch:fixed;
  354. mso-font-signature:-1610611985 1073750091 0 0 159 0;}
  355. /* Style Definitions */
  356. p.MsoNormal, li.MsoNormal, div.MsoNormal
  357. {mso-style-unhide:no;
  358. mso-style-qformat:yes;
  359. mso-style-parent:"";
  360. margin-top:0in;
  361. margin-right:0in;
  362. margin-bottom:10.0pt;
  363. margin-left:0in;
  364. line-height:115%;
  365. mso-pagination:widow-orphan;
  366. font-size:11.0pt;
  367. font-family:"Calibri","sans-serif";
  368. mso-fareast-font-family:"Times New Roman";
  369. mso-fareast-theme-font:minor-fareast;
  370. mso-bidi-font-family:"Times New Roman";}
  371. h1
  372. {mso-style-priority:9;
  373. mso-style-unhide:no;
  374. mso-style-qformat:yes;
  375. mso-style-link:"Heading 1 Char";
  376. margin-top:24.0pt;
  377. margin-right:0in;
  378. margin-bottom:0in;
  379. margin-left:0in;
  380. margin-bottom:.0001pt;
  381. line-height:115%;
  382. mso-pagination:widow-orphan;
  383. page-break-after:avoid;
  384. mso-outline-level:1;
  385. font-size:14.0pt;
  386. font-family:"Cambria","serif";
  387. mso-fareast-font-family:"Times New Roman";
  388. mso-fareast-theme-font:minor-fareast;
  389. color:#365F91;}
  390. h2
  391. {mso-style-priority:9;
  392. mso-style-unhide:no;
  393. mso-style-qformat:yes;
  394. mso-style-link:"Heading 2 Char";
  395. margin-top:10.0pt;
  396. margin-right:0in;
  397. margin-bottom:0in;
  398. margin-left:0in;
  399. margin-bottom:.0001pt;
  400. line-height:115%;
  401. mso-pagination:widow-orphan;
  402. page-break-after:avoid;
  403. mso-outline-level:2;
  404. font-size:13.0pt;
  405. font-family:"Cambria","serif";
  406. mso-fareast-font-family:"Times New Roman";
  407. mso-fareast-theme-font:minor-fareast;
  408. color:#4F81BD;}
  409. h3
  410. {mso-style-priority:9;
  411. mso-style-unhide:no;
  412. mso-style-qformat:yes;
  413. mso-style-link:"Heading 3 Char";
  414. margin-top:10.0pt;
  415. margin-right:0in;
  416. margin-bottom:0in;
  417. margin-left:0in;
  418. margin-bottom:.0001pt;
  419. line-height:115%;
  420. mso-pagination:widow-orphan;
  421. page-break-after:avoid;
  422. mso-outline-level:3;
  423. font-size:11.0pt;
  424. font-family:"Cambria","serif";
  425. mso-fareast-font-family:"Times New Roman";
  426. mso-fareast-theme-font:minor-fareast;
  427. color:#4F81BD;}
  428. p.MsoListBullet, li.MsoListBullet, div.MsoListBullet
  429. {mso-style-noshow:yes;
  430. mso-style-priority:99;
  431. margin-top:0in;
  432. margin-right:0in;
  433. margin-bottom:10.0pt;
  434. margin-left:.25in;
  435. text-indent:-.25in;
  436. line-height:115%;
  437. mso-pagination:widow-orphan;
  438. font-size:11.0pt;
  439. font-family:"Calibri","sans-serif";
  440. mso-fareast-font-family:"Times New Roman";
  441. mso-fareast-theme-font:minor-fareast;
  442. mso-bidi-font-family:"Times New Roman";}
  443. a:link, span.MsoHyperlink
  444. {mso-style-noshow:yes;
  445. mso-style-priority:99;
  446. color:blue;
  447. text-decoration:underline;
  448. text-underline:single;}
  449. a:visited, span.MsoHyperlinkFollowed
  450. {mso-style-noshow:yes;
  451. mso-style-priority:99;
  452. color:purple;
  453. text-decoration:underline;
  454. text-underline:single;}
  455. p.MsoDocumentMap, li.MsoDocumentMap, div.MsoDocumentMap
  456. {mso-style-noshow:yes;
  457. mso-style-priority:99;
  458. mso-style-link:"Document Map Char";
  459. margin:0in;
  460. margin-bottom:.0001pt;
  461. mso-pagination:widow-orphan;
  462. font-size:8.0pt;
  463. font-family:"Tahoma","sans-serif";
  464. mso-fareast-font-family:"Times New Roman";
  465. mso-fareast-theme-font:minor-fareast;}
  466. p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
  467. {mso-style-priority:1;
  468. mso-style-unhide:no;
  469. mso-style-qformat:yes;
  470. margin:0in;
  471. margin-bottom:.0001pt;
  472. mso-pagination:widow-orphan;
  473. font-size:11.0pt;
  474. font-family:"Calibri","sans-serif";
  475. mso-fareast-font-family:"Times New Roman";
  476. mso-fareast-theme-font:minor-fareast;
  477. mso-bidi-font-family:"Times New Roman";}
  478. p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
  479. {mso-style-priority:34;
  480. mso-style-unhide:no;
  481. mso-style-qformat:yes;
  482. margin-top:0in;
  483. margin-right:0in;
  484. margin-bottom:10.0pt;
  485. margin-left:.5in;
  486. line-height:115%;
  487. mso-pagination:widow-orphan;
  488. font-size:11.0pt;
  489. font-family:"Calibri","sans-serif";
  490. mso-fareast-font-family:"Times New Roman";
  491. mso-fareast-theme-font:minor-fareast;
  492. mso-bidi-font-family:"Times New Roman";}
  493. span.Heading1Char
  494. {mso-style-name:"Heading 1 Char";
  495. mso-style-priority:9;
  496. mso-style-unhide:no;
  497. mso-style-locked:yes;
  498. mso-style-link:"Heading 1";
  499. font-family:"Cambria","serif";
  500. mso-ascii-font-family:Cambria;
  501. mso-hansi-font-family:Cambria;
  502. color:#365F91;
  503. font-weight:bold;}
  504. span.Heading2Char
  505. {mso-style-name:"Heading 2 Char";
  506. mso-style-noshow:yes;
  507. mso-style-priority:9;
  508. mso-style-unhide:no;
  509. mso-style-locked:yes;
  510. mso-style-link:"Heading 2";
  511. font-family:"Cambria","serif";
  512. mso-ascii-font-family:Cambria;
  513. mso-hansi-font-family:Cambria;
  514. color:#4F81BD;
  515. font-weight:bold;}
  516. span.Heading3Char
  517. {mso-style-name:"Heading 3 Char";
  518. mso-style-noshow:yes;
  519. mso-style-priority:9;
  520. mso-style-unhide:no;
  521. mso-style-locked:yes;
  522. mso-style-link:"Heading 3";
  523. font-family:"Cambria","serif";
  524. mso-ascii-font-family:Cambria;
  525. mso-hansi-font-family:Cambria;
  526. color:#4F81BD;
  527. font-weight:bold;}
  528. p.msolistbulletcxspfirst, li.msolistbulletcxspfirst, div.msolistbulletcxspfirst
  529. {mso-style-name:msolistbulletcxspfirst;
  530. mso-style-unhide:no;
  531. margin-top:0in;
  532. margin-right:0in;
  533. margin-bottom:0in;
  534. margin-left:.25in;
  535. margin-bottom:.0001pt;
  536. text-indent:-.25in;
  537. line-height:115%;
  538. mso-pagination:widow-orphan;
  539. font-size:11.0pt;
  540. font-family:"Calibri","sans-serif";
  541. mso-fareast-font-family:"Times New Roman";
  542. mso-fareast-theme-font:minor-fareast;
  543. mso-bidi-font-family:"Times New Roman";}
  544. p.msolistbulletcxspmiddle, li.msolistbulletcxspmiddle, div.msolistbulletcxspmiddle
  545. {mso-style-name:msolistbulletcxspmiddle;
  546. mso-style-unhide:no;
  547. margin-top:0in;
  548. margin-right:0in;
  549. margin-bottom:0in;
  550. margin-left:.25in;
  551. margin-bottom:.0001pt;
  552. text-indent:-.25in;
  553. line-height:115%;
  554. mso-pagination:widow-orphan;
  555. font-size:11.0pt;
  556. font-family:"Calibri","sans-serif";
  557. mso-fareast-font-family:"Times New Roman";
  558. mso-fareast-theme-font:minor-fareast;
  559. mso-bidi-font-family:"Times New Roman";}
  560. p.msolistbulletcxsplast, li.msolistbulletcxsplast, div.msolistbulletcxsplast
  561. {mso-style-name:msolistbulletcxsplast;
  562. mso-style-unhide:no;
  563. margin-top:0in;
  564. margin-right:0in;
  565. margin-bottom:10.0pt;
  566. margin-left:.25in;
  567. text-indent:-.25in;
  568. line-height:115%;
  569. mso-pagination:widow-orphan;
  570. font-size:11.0pt;
  571. font-family:"Calibri","sans-serif";
  572. mso-fareast-font-family:"Times New Roman";
  573. mso-fareast-theme-font:minor-fareast;
  574. mso-bidi-font-family:"Times New Roman";}
  575. span.DocumentMapChar
  576. {mso-style-name:"Document Map Char";
  577. mso-style-noshow:yes;
  578. mso-style-priority:99;
  579. mso-style-unhide:no;
  580. mso-style-locked:yes;
  581. mso-style-link:"Document Map";
  582. font-family:"Tahoma","sans-serif";
  583. mso-ascii-font-family:Tahoma;
  584. mso-hansi-font-family:Tahoma;
  585. mso-bidi-font-family:Tahoma;}
  586. p.msolistparagraphcxspfirst, li.msolistparagraphcxspfirst, div.msolistparagraphcxspfirst
  587. {mso-style-name:msolistparagraphcxspfirst;
  588. mso-style-unhide:no;
  589. margin-top:0in;
  590. margin-right:0in;
  591. margin-bottom:0in;
  592. margin-left:.5in;
  593. margin-bottom:.0001pt;
  594. line-height:115%;
  595. mso-pagination:widow-orphan;
  596. font-size:11.0pt;
  597. font-family:"Calibri","sans-serif";
  598. mso-fareast-font-family:"Times New Roman";
  599. mso-fareast-theme-font:minor-fareast;
  600. mso-bidi-font-family:"Times New Roman";}
  601. p.msolistparagraphcxspmiddle, li.msolistparagraphcxspmiddle, div.msolistparagraphcxspmiddle
  602. {mso-style-name:msolistparagraphcxspmiddle;
  603. mso-style-unhide:no;
  604. margin-top:0in;
  605. margin-right:0in;
  606. margin-bottom:0in;
  607. margin-left:.5in;
  608. margin-bottom:.0001pt;
  609. line-height:115%;
  610. mso-pagination:widow-orphan;
  611. font-size:11.0pt;
  612. font-family:"Calibri","sans-serif";
  613. mso-fareast-font-family:"Times New Roman";
  614. mso-fareast-theme-font:minor-fareast;
  615. mso-bidi-font-family:"Times New Roman";}
  616. p.msolistparagraphcxsplast, li.msolistparagraphcxsplast, div.msolistparagraphcxsplast
  617. {mso-style-name:msolistparagraphcxsplast;
  618. mso-style-unhide:no;
  619. margin-top:0in;
  620. margin-right:0in;
  621. margin-bottom:10.0pt;
  622. margin-left:.5in;
  623. line-height:115%;
  624. mso-pagination:widow-orphan;
  625. font-size:11.0pt;
  626. font-family:"Calibri","sans-serif";
  627. mso-fareast-font-family:"Times New Roman";
  628. mso-fareast-theme-font:minor-fareast;
  629. mso-bidi-font-family:"Times New Roman";}
  630. p.Code, li.Code, div.Code
  631. {mso-style-name:Code;
  632. mso-style-unhide:no;
  633. margin-top:0in;
  634. margin-right:0in;
  635. margin-bottom:10.0pt;
  636. margin-left:.5in;
  637. line-height:115%;
  638. mso-pagination:widow-orphan;
  639. font-size:11.0pt;
  640. font-family:Consolas;
  641. mso-fareast-font-family:"Times New Roman";
  642. mso-fareast-theme-font:minor-fareast;
  643. mso-bidi-font-family:"Times New Roman";}
  644. p.msopapdefault, li.msopapdefault, div.msopapdefault
  645. {mso-style-name:msopapdefault;
  646. mso-style-unhide:no;
  647. mso-margin-top-alt:auto;
  648. margin-right:0in;
  649. margin-bottom:10.0pt;
  650. margin-left:0in;
  651. line-height:115%;
  652. mso-pagination:widow-orphan;
  653. font-size:12.0pt;
  654. font-family:"Times New Roman","serif";
  655. mso-fareast-font-family:"Times New Roman";
  656. mso-fareast-theme-font:minor-fareast;}
  657. span.CodeFragment
  658. {mso-style-name:"Code Fragment";
  659. mso-style-unhide:no;
  660. font-family:Consolas;
  661. mso-ascii-font-family:Consolas;
  662. mso-hansi-font-family:Consolas;}
  663. span.SpellE
  664. {mso-style-name:"";
  665. mso-spl-e:yes;}
  666. span.GramE
  667. {mso-style-name:"";
  668. mso-gram-e:yes;}
  669. .MsoChpDefault
  670. {mso-style-type:export-only;
  671. mso-default-props:yes;
  672. font-size:10.0pt;
  673. mso-ansi-font-size:10.0pt;
  674. mso-bidi-font-size:10.0pt;}
  675. .MsoPapDefault
  676. {mso-style-type:export-only;
  677. margin-bottom:10.0pt;
  678. line-height:115%;}
  679. @page Section1
  680. {size:8.5in 11.0in;
  681. margin:1.0in .75in 1.0in .75in;
  682. mso-header-margin:.5in;
  683. mso-footer-margin:.5in;
  684. mso-paper-source:0;}
  685. div.Section1
  686. {page:Section1;}
  687. /* List Definitions */
  688. @list l0
  689. {mso-list-id:-119;
  690. mso-list-type:simple;
  691. mso-list-template-ids:-1170547422;}
  692. @list l0:level1
  693. {mso-level-number-format:bullet;
  694. mso-level-style-link:"List Bullet";
  695. mso-level-text:\F0B7;
  696. mso-level-tab-stop:.25in;
  697. mso-level-number-position:left;
  698. margin-left:.25in;
  699. text-indent:-.25in;
  700. font-family:Symbol;}
  701. ol
  702. {margin-bottom:0in;}
  703. ul
  704. {margin-bottom:0in;}
  705. -->
  706. </style>
  707. <!--[if gte mso 10]>
  708. <style>
  709. /* Style Definitions */
  710. table.MsoNormalTable
  711. {mso-style-name:"Table Normal";
  712. mso-tstyle-rowband-size:0;
  713. mso-tstyle-colband-size:0;
  714. mso-style-noshow:yes;
  715. mso-style-priority:99;
  716. mso-style-qformat:yes;
  717. mso-style-parent:"";
  718. mso-padding-alt:0in 5.4pt 0in 5.4pt;
  719. mso-para-margin-top:0in;
  720. mso-para-margin-right:0in;
  721. mso-para-margin-bottom:10.0pt;
  722. mso-para-margin-left:0in;
  723. line-height:115%;
  724. mso-pagination:widow-orphan;
  725. font-size:10.0pt;
  726. font-family:"Times New Roman","serif";}
  727. </style>
  728. <![endif]--><!--[if gte mso 9]><xml>
  729. <o:shapedefaults v:ext="edit" spidmax="2050"/>
  730. </xml><![endif]--><!--[if gte mso 9]><xml>
  731. <o:shapelayout v:ext="edit">
  732. <o:idmap v:ext="edit" data="1"/>
  733. </o:shapelayout></xml><![endif]-->
  734. </head>
  735. <body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
  736. <div class=Section1>
  737. <h1><span style='mso-fareast-font-family:"Times New Roman"'>Dynamic Expressions
  738. and Queries in LINQ<o:p></o:p></span></h1>
  739. <p class=MsoNormal>Database applications frequently rely on “Dynamic
  740. SQL”—queries that are constructed at run-time through program logic. The LINQ
  741. infrastructure supports similar capabilities through dynamic construction of
  742. expression trees using the classes in the <span class=SpellE><span
  743. class=CodeFragment>System.Linq.Expressions</span></span> namespace. Expression
  744. trees are an appropriate abstraction for a variety of scenarios, but for others
  745. a string-based representation may be more convenient. The <a
  746. href="#_Dynamic_Expression_API">Dynamic Expression API</a> extends the core
  747. LINQ API with that capability. The API is located in the <span class=SpellE>Dynamic.cs</span>
  748. source file and provides</p>
  749. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  750. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  751. </span><span class=GramE>Dynamic</span> parsing of strings to produce
  752. expression trees (the <a href="#_The_ParseLambda_Methods"><span class=SpellE>ParseLambda</span></a>
  753. and <a href="#_The_Parse_Method">Parse</a> methods),</p>
  754. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  755. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  756. </span>Dynamic creation of “Data Classes” (the <a
  757. href="#_Dynamic_Class_Creation"><span class=SpellE>CreateClass</span></a> methods),
  758. and</p>
  759. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  760. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  761. </span><span class=GramE>Dynamic</span> string-based querying through LINQ
  762. providers (the <a href="#_IQueryable_Extension_Methods">IQueryable extension
  763. methods</a>).</p>
  764. <p class=MsoNormal>The Dynamic Expression API relies on a simple <a
  765. href="#_Expression_Language">expression language</a> for formulating
  766. expressions and queries in strings.</p>
  767. <h1><a name="_Dynamic_Expression_API"></a><span style='mso-fareast-font-family:
  768. "Times New Roman"'>Dynamic Expression API<o:p></o:p></span></h1>
  769. <p class=MsoNormal><a name="_The_ParseLambda_Methods"></a>The Dynamic
  770. Expression API is brought into scope by using (importing) the <span
  771. class=SpellE><span class=CodeFragment>System.Linq.Dynamic</span></span>
  772. namespace. Below is an example of applying the Dynamic Expression API to a LINQ
  773. to SQL data source.</p>
  774. <p class=Code><span class=SpellE><span class=GramE><span style='color:blue'>var</span></span></span>
  775. query =<br>
  776. &nbsp;&nbsp;&nbsp; <span class=SpellE>db.Customers</span>.<br>
  777. &nbsp;&nbsp;&nbsp; <span class=GramE>Where(</span><span style='color:#A31515'>&quot;City
  778. = @0 and <span class=SpellE>Orders.Count</span> &gt;= @1&quot;</span>, <span
  779. style='color:#A31515'>&quot;London&quot;</span>, 10).<br>
  780. &nbsp;&nbsp;&nbsp; <span class=SpellE><span class=GramE>OrderBy</span></span><span
  781. class=GramE>(</span><span style='color:#A31515'>&quot;<span class=SpellE>CompanyName</span>&quot;</span>).<br>
  782. &nbsp;&nbsp;&nbsp; <span class=GramE>Select(</span><span style='color:#A31515'>&quot;new(<span
  783. class=SpellE>CompanyName</span> as Name, Phone)&quot;</span>);</p>
  784. <p class=MsoNormal>Note that expressions in the query are strings that could
  785. have been dynamically constructed at run-time.</p>
  786. <h2><span style='mso-fareast-font-family:"Times New Roman"'>The <span
  787. class=SpellE>ParseLambda</span> Methods<o:p></o:p></span></h2>
  788. <p class=MsoNormal>The <span class=SpellE><span class=CodeFragment>System.Linq.Dynamic.DynamicExpression</span></span>
  789. class defines the following overloaded <span class=SpellE><span
  790. class=CodeFragment>ParseLambda</span></span> methods for dynamically parsing
  791. and creating lambda expressions.</p>
  792. <p class=Code><a name=ParseLambda1></a><span class=GramE><span
  793. style='color:blue'>public</span></span> <span style='color:blue'>static</span> <span
  794. class=SpellE><span style='color:#2B91AF'>LambdaExpression</span></span> <span
  795. class=SpellE>ParseLambda</span>(<br>
  796. &nbsp;&nbsp;&nbsp; <span class=SpellE><span style='color:#2B91AF'>ParameterExpression</span></span>[]
  797. parameters, <span style='color:#2B91AF'>Type</span> <span class=SpellE>resultType</span>,<br>
  798. &nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span> expression, <span
  799. class=SpellE><span style='color:blue'>params</span></span> <span
  800. style='color:blue'>object</span>[] values);</p>
  801. <p class=Code><a name=ParseLambda2></a><span class=GramE><span
  802. style='color:blue'>public</span></span> <span style='color:blue'>static</span> <span
  803. class=SpellE><span style='color:#2B91AF'>LambdaExpression</span></span> <span
  804. class=SpellE>ParseLambda</span>(<br>
  805. &nbsp;&nbsp;&nbsp; <span style='color:#2B91AF'>Type</span> <span class=SpellE>argumentType</span>,
  806. <span style='color:#2B91AF'>Type</span> <span class=SpellE>resultType</span>,<br>
  807. &nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span> expression, <span
  808. class=SpellE><span style='color:blue'>params</span></span> <span
  809. style='color:blue'>object</span>[] values);</p>
  810. <p class=Code><a name=ParseLambda3></a><span class=GramE><span
  811. style='color:blue'>public</span></span> <span style='color:blue'>static</span> <span
  812. style='color:#2B91AF'>Expression</span>&lt;<span class=SpellE><span
  813. style='color:#2B91AF'>Func</span></span>&lt;<span class=SpellE>TArgument</span>,
  814. <span class=SpellE>TResult</span>&gt;&gt;<br>
  815. &nbsp;&nbsp;&nbsp; <span class=SpellE>ParseLambda</span>&lt;<span class=SpellE>TArgument</span>,
  816. <span class=SpellE>TResult</span>&gt;(<br>
  817. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span>
  818. expression, <span class=SpellE><span style='color:blue'>params</span></span> <span
  819. style='color:blue'>object</span>[] values);</p>
  820. <p class=MsoNormal>The <a href="#ParseLambda1">first</a> <span class=SpellE><span
  821. class=CodeFragment>ParseLambda</span></span> overload parses a lambda
  822. expression with the given <span class=CodeFragment>parameters</span> and <span
  823. class=CodeFragment>expression</span> body and returns an <span
  824. class=CodeFragment>Expression&lt;<span class=SpellE>Func</span>&lt;…&gt;&gt;</span>
  825. instance representing the result. If the <span class=SpellE><span
  826. class=CodeFragment>resultType</span></span> parameter is non-null it specifies
  827. the required result type for the expression. The <span class=CodeFragment>values</span>
  828. parameter supplies zero or more <a href="#_Substitution_Values">substitution
  829. values</a> that may be referenced in the expression.</p>
  830. <p class=MsoNormal><a name=LambdaExample1></a>The example</p>
  831. <p class=Code><span class=SpellE><span style='color:#2B91AF'>ParameterExpression</span></span>
  832. x = <span class=SpellE><span style='color:#2B91AF'>Expression</span>.Parameter</span>(<span
  833. class=SpellE><span style='color:blue'>typeof</span></span>(<span class=SpellE><span
  834. style='color:blue'>int</span></span>), <span style='color:#A31515'>&quot;x&quot;</span>);<br>
  835. <span class=SpellE><span style='color:#2B91AF'>ParameterExpression</span></span>
  836. y = <span class=SpellE><span style='color:#2B91AF'>Expression</span>.Parameter</span>(<span
  837. class=SpellE><span style='color:blue'>typeof</span></span>(<span class=SpellE><span
  838. style='color:blue'>int</span></span>), <span style='color:#A31515'>&quot;y&quot;</span>);<br>
  839. <span class=SpellE><span style='color:#2B91AF'>LambdaExpression</span></span> e
  840. = <span class=SpellE><span style='color:#2B91AF'>DynamicExpression</span>.ParseLambda</span>(<br>
  841. &nbsp;&nbsp;&nbsp; <span style='color:blue'>new</span> <span class=SpellE><span
  842. style='color:#2B91AF'>ParameterExpression</span></span>[] { x, y }, <span
  843. style='color:blue'>null</span>, <span style='color:#A31515'>&quot;(x + y) *
  844. 2&quot;</span>);</p>
  845. <p class=MsoNormal><span class=GramE>creates</span> and assigns an <span
  846. class=CodeFragment>Expression&lt;<span class=SpellE>Func</span>&lt;<span
  847. class=SpellE>int</span>, <span class=SpellE>int</span>, <span class=SpellE>int</span>&gt;&gt;</span>
  848. instance to <span class=CodeFragment>e</span> representing the expression <span
  849. class=CodeFragment>(x</span> <span class=CodeFragment>+</span> <span
  850. class=CodeFragment>y)</span> <span class=CodeFragment>*</span> <span
  851. class=CodeFragment>2</span>. If a required result type is specified, as in</p>
  852. <p class=Code><span class=SpellE><span style='color:#2B91AF'>LambdaExpression</span></span>
  853. e = <span class=SpellE><span class=GramE><span style='color:#2B91AF'>DynamicExpression</span>.ParseLambda</span></span><span
  854. class=GramE>(</span><br>
  855. &nbsp;&nbsp;&nbsp; <span style='color:blue'>new</span> <span class=SpellE><span
  856. style='color:#2B91AF'>ParameterExpression</span></span>[] { x, y }, <span
  857. class=SpellE><span style='color:blue'>typeof</span></span>(<span
  858. style='color:blue'>double</span>), <span style='color:#A31515'>&quot;(x + y) *
  859. 2&quot;</span>);</p>
  860. <p class=MsoNormal><span class=GramE>the</span> parsing operation will include
  861. an <a href="#_Conversions">implicit conversion</a> to the given result type, in
  862. this case yielding an <span class=CodeFragment>Expression&lt;<span
  863. class=SpellE>Func</span>&lt;<span class=SpellE>int</span>, <span class=SpellE>int</span>,
  864. double&gt;&gt;</span> instance.</p>
  865. <p class=MsoNormal>The <a href="#ParseLambda2">second</a> <span class=SpellE><span
  866. class=CodeFragment>ParseLambda</span></span> overload parses a lambda
  867. expression with a single unnamed parameter of a specified <span class=SpellE><span
  868. class=CodeFragment>argumentType</span></span>. This method corresponds to
  869. calling the first <span class=SpellE>ParseLambda</span> overload with a <span
  870. class=CodeFragment>parameters</span> argument containing a single <span
  871. class=SpellE><span class=CodeFragment>ParameterExpression</span></span> with an
  872. empty or null <span class=CodeFragment>Name</span> property.</p>
  873. <p class=MsoNormal>­When parsing a lambda expression with a single unnamed
  874. parameter, the members of the unnamed parameter are automatically in scope in
  875. the expression string, and the <a href="#_Current_Instance">current instance</a>
  876. given by the unnamed parameter can be referenced in whole using the keyword <span
  877. class=CodeFragment>it</span>. The example</p>
  878. <p class=Code><span class=SpellE><span style='color:#2B91AF'>LambdaExpression</span></span>
  879. e = <span class=SpellE><span class=GramE><span style='color:#2B91AF'>DynamicExpression</span>.ParseLambda</span></span><span
  880. class=GramE>(</span><br>
  881. &nbsp;&nbsp;&nbsp; <span class=SpellE><span style='color:blue'>typeof</span></span>(<span
  882. style='color:#2B91AF'>Customer</span>), <span class=SpellE><span
  883. style='color:blue'>typeof</span></span>(<span class=SpellE><span
  884. style='color:blue'>bool</span></span>),<br>
  885. &nbsp;&nbsp;&nbsp; <span style='color:#A31515'>&quot;City = @0 and <span
  886. class=SpellE>Orders.Count</span> &gt;= @1&quot;</span>,<br>
  887. &nbsp;&nbsp;&nbsp; <span style='color:#A31515'>&quot;London&quot;</span>, 10);</p>
  888. <p class=MsoNormal><span class=GramE>creates</span> and assigns an <span
  889. class=CodeFragment>Expression&lt;<span class=SpellE>Func</span>&lt;Customer, <span
  890. class=SpellE>bool</span>&gt;&gt;</span> instance to <span class=CodeFragment>e</span>.
  891. Note that <span class=CodeFragment>City</span> and <span class=CodeFragment>Orders</span>
  892. are members of <span class=CodeFragment>Customer</span> that are automatically
  893. in scope. Also note the use of <a href="#_Substitution_Values">substitution
  894. values</a> to supply the constant values <span class=CodeFragment>&quot;London&quot;</span>
  895. and <span class=CodeFragment>10</span>.</p>
  896. <p class=MsoNormal>The <a href="#ParseLambda3">third</a> <span class=SpellE><span
  897. class=CodeFragment>ParseLambda</span></span> overload is a <span class=SpellE>genericly</span>
  898. typed version of the second overload. The example below produces the same <span
  899. class=CodeFragment>Expression&lt;<span class=SpellE>Func</span>&lt;Customer, <span
  900. class=SpellE>bool</span>&gt;&gt;</span> instance as the example above, but is
  901. statically typed to that exact type.</p>
  902. <p class=Code><span style='color:#2B91AF'>Expression</span>&lt;<span
  903. class=SpellE><span style='color:#2B91AF'>Func</span></span>&lt;<span
  904. style='color:#2B91AF'>Customer</span>, <span class=SpellE><span
  905. style='color:blue'>bool</span></span>&gt;&gt; e =<br>
  906. &nbsp;&nbsp;&nbsp; <span class=SpellE><span style='color:#2B91AF'>DynamicExpression</span>.ParseLambda</span>&lt;<span
  907. style='color:#2B91AF'>Customer</span>, <span class=SpellE><span
  908. style='color:blue'>bool</span></span><span class=GramE>&gt;(</span><br>
  909. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:#A31515'>&quot;City
  910. = @0 and <span class=SpellE>Orders.Count</span> &gt;= @1&quot;</span>,<br>
  911. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style='color:#A31515'>&quot;London&quot;</span>,
  912. 10);</p>
  913. <h2><a name="_The_Parse_Method"></a><span style='mso-fareast-font-family:"Times New Roman"'>The
  914. Parse Method<o:p></o:p></span></h2>
  915. <p class=MsoNormal>The <span class=SpellE><span class=CodeFragment>System.Linq.Dynamic.DynamicExpression</span></span>
  916. class defines the following method for parsing and creating expression tree
  917. fragments.</p>
  918. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  919. style='color:blue'>static</span> <span style='color:#2B91AF'>Expression</span>
  920. Parse(<span style='color:#2B91AF'>Type</span> <span class=SpellE>resultType</span>,
  921. <span style='color:blue'>string</span> expression,<br>
  922. &nbsp;&nbsp;&nbsp; <span class=SpellE><span style='color:blue'>params</span></span>
  923. <span style='color:blue'>object</span>[] values);</p>
  924. <p class=MsoNormal>The Parse method parses the given <span class=CodeFragment>expression</span>
  925. and returns an expression tree. If the <span class=SpellE><span
  926. class=CodeFragment>resultType</span></span> parameter is non-null it specifies
  927. the required result type of the expression. The <span class=CodeFragment>values</span>
  928. parameter supplies zero or more <a href="#_Substitution_Values">substitution
  929. values</a> that may be referenced in the expression.</p>
  930. <p class=MsoNormal>Unlike the <span class=SpellE><span class=CodeFragment>ParseLambda</span></span>
  931. methods, the <span class=CodeFragment>Parse</span> method returns an “unbound”
  932. expression tree fragment. The following example uses <span class=GramE><span
  933. class=CodeFragment>Parse</span></span> to produce the same result as a <a
  934. href="#LambdaExample1">previous example</a>:</p>
  935. <p class=Code><span class=SpellE><span style='color:#2B91AF'>ParameterExpression</span></span>
  936. x = <span class=SpellE><span style='color:#2B91AF'>Expression</span>.Parameter</span>(<span
  937. class=SpellE><span style='color:blue'>typeof</span></span>(<span class=SpellE><span
  938. style='color:blue'>int</span></span>), <span style='color:#A31515'>&quot;x&quot;</span>);<br>
  939. <span class=SpellE><span style='color:#2B91AF'>ParameterExpression</span></span>
  940. y = <span class=SpellE><span style='color:#2B91AF'>Expression</span>.Parameter</span>(<span
  941. class=SpellE><span style='color:blue'>typeof</span></span>(<span class=SpellE><span
  942. style='color:blue'>int</span></span>), <span style='color:#A31515'>&quot;y&quot;</span>);<br>
  943. <span style='color:#2B91AF'>Dictionary</span>&lt;<span style='color:blue'>string</span>,
  944. <span style='color:blue'>object</span>&gt; symbols = <span style='color:blue'>new</span>
  945. <span style='color:#2B91AF'>Dictionary</span>&lt;<span style='color:blue'>string</span>,
  946. <span style='color:blue'>object</span>&gt;();<br>
  947. <span class=SpellE>symbols.Add</span>(<span style='color:#A31515'>&quot;x&quot;</span>,
  948. x);<br>
  949. <span class=SpellE>symbols.Add</span>(<span style='color:#A31515'>&quot;y&quot;</span>,
  950. y);<br>
  951. <span style='color:#2B91AF'>Expression</span> body = <span class=SpellE><span
  952. style='color:#2B91AF'>DynamicExpression</span>.Parse</span>(<span
  953. style='color:blue'>null</span>, <span style='color:#A31515'>&quot;(x + y) *
  954. 2&quot;</span>, symbols);<br>
  955. <span class=SpellE><span style='color:#2B91AF'>LambdaExpression</span></span> e
  956. = <span class=SpellE><span style='color:#2B91AF'>Expression</span>.Lambda</span>(<br>
  957. &nbsp;&nbsp;&nbsp; body, <span style='color:blue'>new</span> <span
  958. class=SpellE><span style='color:#2B91AF'>ParameterExpression</span></span>[] {
  959. x, y });</p>
  960. <p class=MsoNormal>Note the use of a <span class=CodeFragment>Dictionary&lt;string,
  961. object&gt;</span> to provide a dictionary of named <a
  962. href="#_Substitution_Values">substitution values</a> that can be referenced in
  963. the expression.</p>
  964. <h2><a name="_Substitution_Values"></a><span style='mso-fareast-font-family:
  965. "Times New Roman"'>Substitution Values<o:p></o:p></span></h2>
  966. <p class=MsoNormal>Several methods in the Dynamic Expression API permit <em><span
  967. style='font-family:"Calibri","sans-serif"'>substitution values</span></em> to
  968. be specified through a parameter array. Substitution values are referenced in
  969. an expression using <a href="#_Identifiers">identifiers</a> of the form <span
  970. class=CodeFragment>@x</span>, where <span class=CodeFragment>x</span> is an
  971. index into the parameter array. The last element of the parameter array may be
  972. an object that implements <span class=SpellE><span class=CodeFragment>IDictionary</span></span><span
  973. class=CodeFragment>&lt;string, object&gt;</span>. If so, this dictionary is
  974. used to map identifiers to substitution values during parsing.</p>
  975. <p class=MsoNormal>An identifier that references a substitution value is
  976. processed as follows:</p>
  977. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  978. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  979. </span><span class=GramE>If</span> the value is of type <span class=SpellE><span
  980. class=CodeFragment>System.Linq.Expressions.LambdaExpression</span></span>, the
  981. identifier must occur as part of a <a href="#_Dynamic_Expression_Invocation">dynamic
  982. lambda invocation</a>. This allows composition of dynamic lambda expressions.</p>
  983. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  984. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  985. </span>Otherwise, if the value is of type <span class=SpellE><span
  986. class=CodeFragment>System.Linq.Expressions.Expression</span></span>, the given
  987. expression is substituted for the identifier.</p>
  988. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  989. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  990. </span>Otherwise, the <span class=SpellE><span class=CodeFragment>Expression.Constant</span></span><span
  991. class=CodeFragment> </span>method is used to create a constant expression from
  992. the value which is then substituted for the identifier.</p>
  993. <h2><a name="_Dynamic_Class_Creation"></a><a name="_Dynamic_Data_Classes"></a><span
  994. style='mso-fareast-font-family:"Times New Roman"'>Dynamic Data Classes<o:p></o:p></span></h2>
  995. <p class=MsoNormal>A data class is a class that contains only data members. The
  996. <span class=SpellE><span class=CodeFragment>System.Linq.Dynamic.DynamicExpression</span></span>
  997. class defines the following methods for dynamically creating data classes.</p>
  998. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  999. style='color:blue'>static</span> <span style='color:#2B91AF'>Type</span> <span
  1000. class=SpellE>CreateClass</span>(<span class=SpellE><span style='color:blue'>params</span></span>
  1001. <span class=SpellE><span style='color:#2B91AF'>DynamicProperty</span></span>[]
  1002. properties);</p>
  1003. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1004. style='color:blue'>static</span> <span style='color:#2B91AF'>Type</span> <span
  1005. class=SpellE>CreateClass</span>(<span class=SpellE><span style='color:#2B91AF'>IEnumerable</span></span>&lt;<span
  1006. class=SpellE><span style='color:#2B91AF'>DynamicProperty</span></span>&gt;
  1007. properties);</p>
  1008. <p class=MsoNormal>The <span class=SpellE><span class=CodeFragment>CreateClass</span></span>
  1009. method creates a new data class with a given set of public properties and
  1010. returns the <span class=SpellE><span class=CodeFragment>System.Type</span></span>
  1011. object for the newly created class. If a data class with an identical sequence
  1012. of properties has already been created, the <span class=SpellE><span
  1013. class=CodeFragment>System.Type</span></span> object for this class is returned.</p>
  1014. <p class=MsoNormal>Data classes implement private instance variables and
  1015. read/write property <span class=SpellE>accessors</span> for the specified
  1016. properties. Data classes also override the <span class=CodeFragment>Equals</span>
  1017. and <span class=SpellE><span class=CodeFragment>GetHashCode</span></span>
  1018. members to implement by-value equality.</p>
  1019. <p class=MsoNormal>Data classes are created in an in-memory assembly in the
  1020. current application domain. All data classes inherit from <span class=SpellE><span
  1021. class=CodeFragment>System.Linq.Dynamic.DynamicClass</span></span> and are given
  1022. automatically generated names that should be considered private (the names will
  1023. be unique within the application domain but not across multiple invocations of
  1024. the application). Note that once created, a data class stays in memory for the
  1025. lifetime of the current application domain. There is currently no way to unload
  1026. a dynamically created data class.</p>
  1027. <p class=MsoNormal>The dynamic expression parser uses the <span class=SpellE><span
  1028. class=CodeFragment>CreateClass</span></span> methods to generate classes from <a
  1029. href="#_Anonymous_Object_Initializer">data object initializers</a>. This
  1030. feature in turn is often used with the dynamic <span class=CodeFragment>Select</span>
  1031. method to create projections.</p>
  1032. <p class=MsoNormal>The example below uses <span class=SpellE><span
  1033. class=CodeFragment>CreateClass</span></span> to create a data class with two
  1034. properties, <span class=CodeFragment>Name</span> and <span class=CodeFragment>Birthday</span>,
  1035. and then uses .NET reflection to create an instance of the class and assign
  1036. values to the properties.</p>
  1037. <p class=Code><span class=SpellE><span style='color:#2B91AF'>DynamicProperty</span></span>[]
  1038. props = <span style='color:blue'>new</span> <span class=SpellE><span
  1039. style='color:#2B91AF'>DynamicProperty</span></span>[] {<br>
  1040. &nbsp;&nbsp;&nbsp; <span style='color:blue'>new</span> <span class=SpellE><span
  1041. style='color:#2B91AF'>DynamicProperty</span></span>(<span style='color:#A31515'>&quot;Name&quot;</span>,
  1042. <span class=SpellE><span style='color:blue'>typeof</span></span>(<span
  1043. style='color:blue'>string</span>)),<br>
  1044. &nbsp;&nbsp;&nbsp; <span style='color:blue'>new</span> <span class=SpellE><span
  1045. style='color:#2B91AF'>DynamicProperty</span></span>(<span style='color:#A31515'>&quot;Birthday&quot;</span>,
  1046. <span class=SpellE><span style='color:blue'>typeof</span></span>(<span
  1047. class=SpellE><span style='color:#2B91AF'>DateTime</span></span>)) };<br>
  1048. <span style='color:#2B91AF'>Type</span> <span class=SpellE>type</span> = <span
  1049. class=SpellE><span style='color:#2B91AF'>DynamicExpression</span>.CreateClass</span>(props);<br>
  1050. <span style='color:blue'>object</span> <span class=SpellE>obj</span> = <span
  1051. class=SpellE><span style='color:#2B91AF'>Activator</span>.CreateInstance</span>(type);<br>
  1052. <span class=SpellE>t.GetProperty</span>(<span style='color:#A31515'>&quot;Name&quot;</span>).<span
  1053. class=SpellE>SetValue</span>(<span class=SpellE>obj</span>, <span
  1054. style='color:#A31515'>&quot;Albert&quot;</span>, <span style='color:blue'>null</span>);<br>
  1055. <span class=SpellE>t.GetProperty</span>(<span style='color:#A31515'>&quot;Birthday&quot;</span>).<span
  1056. class=SpellE>SetValue</span>(<span class=SpellE>obj</span>, <span
  1057. style='color:blue'>new</span> <span class=SpellE><span style='color:#2B91AF'>DateTime</span></span>(1879,
  1058. 3, 14), <span style='color:blue'>null</span>);<br>
  1059. <span class=SpellE><span style='color:#2B91AF'>Console</span>.WriteLine</span>(<span
  1060. class=SpellE>obj</span>);</p>
  1061. <h2><a name="_IQueryable_Extension_Methods"></a><span style='mso-fareast-font-family:
  1062. "Times New Roman"'>IQueryable Extension Methods<o:p></o:p></span></h2>
  1063. <p class=MsoNormal>The <span class=SpellE><span class=CodeFragment>System.Linq.Dynamic.DynamicQueryable</span></span>
  1064. class implements the following extension methods for dynamically querying
  1065. objects that implement the <span class=CodeFragment>IQueryable&lt;T&gt;</span>
  1066. interface.</p>
  1067. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1068. style='color:blue'>static</span> <span style='color:#2B91AF'>IQueryable</span>
  1069. Where(<span style='color:blue'>this</span> <span style='color:#2B91AF'>IQueryable</span>
  1070. source,<br>
  1071. &nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span> predicate, <span
  1072. class=SpellE><span style='color:blue'>params</span></span> <span
  1073. style='color:blue'>object</span>[] values);</p>
  1074. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1075. style='color:blue'>static</span> <span style='color:#2B91AF'>IQueryable</span>&lt;T&gt;
  1076. Where&lt;T&gt;(<span style='color:blue'>this</span> <span style='color:#2B91AF'>IQueryable</span>&lt;T&gt;
  1077. source,<br>
  1078. &nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span> predicate, <span
  1079. class=SpellE><span style='color:blue'>params</span></span> <span
  1080. style='color:blue'>object</span>[] values);</p>
  1081. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1082. style='color:blue'>static</span> <span style='color:#2B91AF'>IQueryable</span>
  1083. Select(<span style='color:blue'>this</span> <span style='color:#2B91AF'>IQueryable</span>
  1084. source,<br>
  1085. &nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span> selector, <span
  1086. class=SpellE><span style='color:blue'>params</span></span> <span
  1087. style='color:blue'>object</span>[] values);</p>
  1088. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1089. style='color:blue'>static</span> <span style='color:#2B91AF'>IQueryable</span> <span
  1090. class=SpellE>OrderBy</span>(<span style='color:blue'>this</span> <span
  1091. style='color:#2B91AF'>IQueryable</span> source,<br>
  1092. &nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span> ordering, <span
  1093. class=SpellE><span style='color:blue'>params</span></span> <span
  1094. style='color:blue'>object</span>[] values);</p>
  1095. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1096. style='color:blue'>static</span> <span style='color:#2B91AF'>IQueryable</span>&lt;T&gt;
  1097. <span class=SpellE>OrderBy</span>&lt;T&gt;(<span style='color:blue'>this</span>
  1098. <span style='color:#2B91AF'>IQueryable</span>&lt;T&gt; source,<br>
  1099. &nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span> ordering, <span
  1100. class=SpellE><span style='color:blue'>params</span></span> <span
  1101. style='color:blue'>object</span>[] values);</p>
  1102. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1103. style='color:blue'>static</span> <span style='color:#2B91AF'>IQueryable</span>
  1104. Take(<span style='color:blue'>this</span> <span style='color:#2B91AF'>IQueryable</span>
  1105. source, <span class=SpellE><span style='color:blue'>int</span></span> count);</p>
  1106. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1107. style='color:blue'>static</span> <span style='color:#2B91AF'>IQueryable</span>
  1108. Skip(<span style='color:blue'>this</span> <span style='color:#2B91AF'>IQueryable</span>
  1109. source, <span class=SpellE><span style='color:blue'>int</span></span> count);</p>
  1110. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1111. style='color:blue'>static</span> <span style='color:#2B91AF'>IQueryable</span> <span
  1112. class=SpellE>GroupBy</span>(<span style='color:blue'>this</span> <span
  1113. style='color:#2B91AF'>IQueryable</span> source,<br>
  1114. &nbsp;&nbsp;&nbsp; <span style='color:blue'>string</span> <span class=SpellE>keySelector</span>,
  1115. <span style='color:blue'>string</span> <span class=SpellE>elementSelector</span>,
  1116. <span class=SpellE><span style='color:blue'>params</span></span> <span
  1117. style='color:blue'>object</span>[] values);</p>
  1118. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1119. style='color:blue'>static</span> <span class=SpellE><span style='color:blue'>bool</span></span>
  1120. Any(<span style='color:blue'>this</span> <span style='color:#2B91AF'>IQueryable</span>
  1121. source);</p>
  1122. <p class=Code><span class=GramE><span style='color:blue'>public</span></span> <span
  1123. style='color:blue'>static</span> <span class=SpellE><span style='color:blue'>int</span></span>
  1124. Count(<span style='color:blue'>this</span> <span style='color:#2B91AF'>IQueryable</span>
  1125. source);</p>
  1126. <p class=MsoNormal>These methods correspond to their <span class=SpellE><span
  1127. class=CodeFragment>System.Linq.Queryable</span></span> counterparts, except
  1128. that they operate on <span class=CodeFragment>IQueryable</span> instead of <span
  1129. class=CodeFragment>IQueryable&lt;T&gt;</span> and use strings instead of lambda
  1130. expressions to express predicates, selectors, and orderings. <span
  1131. class=CodeFragment>IQueryable</span> is the non-generic base interface for <span
  1132. class=CodeFragment>IQueryable&lt;T&gt;</span>, so the methods can be used even
  1133. when <span class=CodeFragment>T</span> isn’t known on beforehand, i.e. when the
  1134. source of a query is dynamically determined. (Note that because a dynamic
  1135. predicate or ordering does not affect the result type, generic overloads are
  1136. provided for <span class=CodeFragment>Where</span> and <span class=SpellE><span
  1137. class=CodeFragment>OrderBy</span></span> in order to preserve strong typing
  1138. when possible.)</p>
  1139. <p class=MsoNormal>The <span class=CodeFragment>predicate</span>, <span
  1140. class=CodeFragment>selector</span>, <span class=CodeFragment>ordering</span>, <span
  1141. class=SpellE><span class=CodeFragment>keySelector</span></span>, and <span
  1142. class=SpellE><span class=CodeFragment>elementSelector</span></span> parameters
  1143. are strings containing expressions written in the <a
  1144. href="#_Expression_Language">expression language</a>. In the expression
  1145. strings, the members of the <a href="#_Current_Instance">current instance</a>
  1146. are automatically in scope and the instance itself can be referenced using the
  1147. keyword <span class=CodeFragment>it</span>.</p>
  1148. <p class=MsoNormal>The <span class=SpellE><span class=CodeFragment>OrderBy</span></span>
  1149. method permits a sequence of orderings to be specified, separated by commas.
  1150. Each ordering may optionally be followed by <span class=SpellE><span
  1151. class=CodeFragment>asc</span></span> or <span class=CodeFragment>ascending</span>
  1152. to indicate ascending <span class=GramE>order,</span> or <span class=SpellE><span
  1153. class=CodeFragment>desc</span></span> or <span class=CodeFragment>descending</span>
  1154. to indicate descending order. The default order is ascending. The example</p>
  1155. <p class=Code><span class=SpellE><span class=GramE>products.OrderBy</span></span><span
  1156. class=GramE>(</span><span style='color:#A31515'>&quot;<span class=SpellE>Category.CategoryName</span>,
  1157. <span class=SpellE>UnitPrice</span> descending&quot;</span>);</p>
  1158. <p class=MsoNormal><span class=GramE>orders</span> a sequence of products by
  1159. ascending category name and, within each category, descending unit price.</p>
  1160. <h2><span style='mso-fareast-font-family:"Times New Roman"'>The <span
  1161. class=SpellE>ParseException</span> Class<o:p></o:p></span></h2>
  1162. <p class=MsoNormal>The Dynamic Expression API reports parsing errors using the <span
  1163. class=SpellE><span class=CodeFragment>System.Linq.Dynamic.ParseException</span></span>
  1164. class. The <span class=CodeFragment>Position</span> property of the <span
  1165. class=SpellE><span class=CodeFragment>ParseException</span></span> class gives
  1166. the character index in the expression string at which the parsing error
  1167. occurred.</p>
  1168. <h1><a name="_Expression_Language"></a><span style='mso-fareast-font-family:
  1169. "Times New Roman"'>Expression Language<o:p></o:p></span></h1>
  1170. <p class=MsoNormal>The expression language implemented by the Dynamic
  1171. Expression API provides a simple and convenient way of writing expressions that
  1172. can be parsed into LINQ expression trees. The language supports most of the
  1173. constructs of expression trees, but it is by no means a complete query or
  1174. programming language. In particular, the expression language does not support
  1175. statements or declarations.</p>
  1176. <p class=MsoNormal>The expression language is designed to be familiar to C#,
  1177. VB, and SQL users. For this reason, some operators are present in multiple
  1178. forms, such as <span class=CodeFragment>&amp;&amp;</span> and <span
  1179. class=SpellE><span class=CodeFragment>and</span></span>.</p>
  1180. <h2><a name="_Identifiers"></a><span style='mso-fareast-font-family:"Times New Roman"'>Identifiers<o:p></o:p></span></h2>
  1181. <p class=MsoNormal>An Identifier consists of a letter or underscore followed by
  1182. any number of letters, digits, or underscores. In order to reference an
  1183. identifier with the same spelling as a keyword, the identifier must be prefixed
  1184. with a single @ character. Some examples of identifiers:</p>
  1185. <p class=Code><span class=GramE>x</span>&nbsp;&nbsp; Hello&nbsp;&nbsp;
  1186. m_1&nbsp;&nbsp; @true&nbsp;&nbsp; @String</p>
  1187. <p class=MsoNormal>Identifiers of the from @x, where x is an integral number
  1188. greater than or equal to zero, are used to denote the <a
  1189. href="#_Substitution_Values">substitution values</a>, if any, that were passed
  1190. to the expression parser. For example:</p>
  1191. <p class=Code><span class=SpellE><span class=GramE>customers.Where</span></span><span
  1192. class=GramE>(</span><span style='color:#A31515'>&quot;Country = @0&quot;</span>,
  1193. country);</p>
  1194. <p class=MsoNormal>Casing is not significant in identifiers or keywords.</p>
  1195. <h2><span style='mso-fareast-font-family:"Times New Roman"'>Literals<o:p></o:p></span></h2>
  1196. <p class=MsoNormal>The expression language supports integer, real, string, and
  1197. character literals.</p>
  1198. <p class=MsoNormal>An <em><span style='font-family:"Calibri","sans-serif"'>integer
  1199. literal</span></em> consists of a sequence of digits. The type of an integer
  1200. literal is the first of the types <span class=CodeFragment>Int32</span>, <span
  1201. class=CodeFragment>UInt32</span>, <span class=CodeFragment>Int64</span>, or <span
  1202. class=CodeFragment>UInt64</span> that can represent the given value. An integer
  1203. literal implicitly converts to any other <a href="#NumericTypes">numeric type</a>
  1204. provided the number is in the range of that type. Some examples of integer
  1205. literals:</p>
  1206. <p class=Code>0&nbsp;&nbsp; 123&nbsp;&nbsp; 10000</p>
  1207. <p class=MsoNormal>A <em><span style='font-family:"Calibri","sans-serif"'>real
  1208. literal</span></em> consists of an integral part followed by a fractional part
  1209. and/or an exponent. The integral part is a sequence of one or more digits. The
  1210. fractional part is a decimal point followed by one or more digits. The exponent
  1211. is the letter <span class=CodeFragment>e</span> or <span class=CodeFragment>E</span>
  1212. followed by an optional <span class=CodeFragment>+</span> or <span
  1213. class=CodeFragment>–</span> sign followed by one or more digits. The type of a
  1214. real literal is <span class=GramE><span class=CodeFragment>Double</span></span>.
  1215. A real literal implicitly converts to any other <a href="#RealTypes">real type</a>
  1216. provided the number is in the range of that type. Some examples of real
  1217. literals:</p>
  1218. <p class=Code>1.0&nbsp;&nbsp; 2.25 &nbsp;&nbsp;10000.0&nbsp;&nbsp;
  1219. 1e0&nbsp;&nbsp; 1e10&nbsp;&nbsp; 1.2345E-4</p>
  1220. <p class=MsoNormal>A <em><span style='font-family:"Calibri","sans-serif"'>string
  1221. literal</span></em> consists of zero or more characters enclosed in double
  1222. quotes. Inside a string literal, a double quote is written as two consecutive
  1223. double quotes. The type of a string literal is <span class=CodeFragment>String</span>.
  1224. Some examples of string literals:</p>
  1225. <p class=Code>&quot;<span class=GramE>hello</span>&quot;&nbsp;&nbsp;
  1226. &quot;&quot;&nbsp;&nbsp;&nbsp;
  1227. &quot;&quot;&quot;quoted&quot;&quot;&quot;&nbsp;&nbsp; &quot;'&quot;</p>
  1228. <p class=MsoNormal>A <em><span style='font-family:"Calibri","sans-serif"'>character
  1229. literal</span></em> consists of a single character enclosed in single quotes.
  1230. Inside a character literal, a single quote is written as two consecutive single
  1231. quotes. The type of a character literal is <span class=CodeFragment>Char</span>.
  1232. Some examples of character literals:</p>
  1233. <p class=Code>'A'&nbsp;&nbsp; '1'&nbsp;&nbsp; ''''&nbsp;&nbsp; '&quot;'</p>
  1234. <h2><span style='mso-fareast-font-family:"Times New Roman"'>Constants<o:p></o:p></span></h2>
  1235. <p class=MsoNormal>The predefined constants <span class=CodeFragment>true</span>
  1236. and <span class=CodeFragment>false</span> denote the two values of the type <span
  1237. class=CodeFragment>Boolean</span>.</p>
  1238. <p class=MsoNormal>The predefined constant <span class=CodeFragment>null</span>
  1239. denotes a null reference. The <span class=CodeFragment>null</span> constant is
  1240. of type <span class=CodeFragment>Object</span>, but is also implicitly
  1241. convertible to any reference type.</p>
  1242. <h2><a name="_Predefined_types"></a><a name="_Types"></a><span
  1243. style='mso-fareast-font-family:"Times New Roman"'>Types<o:p></o:p></span></h2>
  1244. <p class=MsoNormal>The expression language defines the following <em><span
  1245. style='font-family:"Calibri","sans-serif"'>primitive types</span></em>:</p>
  1246. <p class=MsoNormal style='margin-left:.5in'><span class=CodeFragment>Object</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1247. <span class=CodeFragment>Boolean</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1248. <span class=CodeFragment>Char</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1249. <span class=CodeFragment>String</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1250. <span class=SpellE><span class=CodeFragment>SByte</span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1251. <span class=CodeFragment>Byte</span><br>
  1252. <span class=CodeFragment>Int16</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1253. <span class=CodeFragment>UInt16</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1254. <span class=CodeFragment>Int32</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1255. <span class=CodeFragment>UInt32</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1256. <span class=CodeFragment>Int64</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1257. <span class=CodeFragment>UInt64</span><br>
  1258. <span class=CodeFragment>Decimal&nbsp;&nbsp;&nbsp;&nbsp; Single</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1259. <span class=CodeFragment>Double</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1260. <span class=SpellE><span class=CodeFragment>DateTime</span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1261. <span class=SpellE><span class=CodeFragment>TimeSpan</span></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1262. <span class=SpellE><span class=CodeFragment>Guid</span></span></p>
  1263. <p class=MsoNormal>The primitive types correspond to the similarly named types
  1264. in the System namespace of the .NET Framework Base Class Library. The
  1265. expression language also defines a set of <em><span style='font-family:"Calibri","sans-serif"'>accessible
  1266. types</span></em> consisting of the primitive types and the following types
  1267. from the System namespace:</p>
  1268. <p class=MsoNormal style='margin-left:.5in'><span class=CodeFragment>Math</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1269. <span class=CodeFragment>Convert</span></p>
  1270. <p class=MsoNormal>The accessible types are the only types that can be
  1271. explicitly referenced in expressions, and method invocations in the expression
  1272. language are restricted to methods declared in the accessible types.</p>
  1273. <p class=MsoNormal>The <span class=SpellE><em><span style='font-family:"Calibri","sans-serif"'>nullable</span></em></span><em><span
  1274. style='font-family:"Calibri","sans-serif"'> form</span></em> of a value type is
  1275. referenced by writing <span class=GramE>a <span class=CodeFragment>?</span></span>
  1276. <span class=GramE>after</span> the type name. <span class=GramE>For example, <span
  1277. class=CodeFragment>Int32?</span></span> <span class=GramE>denotes</span> the <span
  1278. class=SpellE>nullable</span> form of <span class=CodeFragment>Int32</span>.</p>
  1279. <p class=MsoNormal><a name=IntegralTypes></a>The non-<span class=SpellE>nullable</span>
  1280. and <span class=SpellE>nullable</span> forms of the types <span class=SpellE><span
  1281. class=CodeFragment>SByte</span></span>, <span class=CodeFragment>Byte</span>, <span
  1282. class=CodeFragment>Int16</span>, <span class=CodeFragment>UInt16</span>, <span
  1283. class=CodeFragment>Int32</span>, <span class=CodeFragment>UInt32</span>, <span
  1284. class=CodeFragment>Int64</span>, and <span class=CodeFragment>UInt64</span> are
  1285. collectively called the <em><span style='font-family:"Calibri","sans-serif"'>integral
  1286. types</span></em>. </p>
  1287. <p class=MsoNormal><a name="_Conversions"></a><a name=RealTypes></a>The non-<span
  1288. class=SpellE>nullable</span> and <span class=SpellE>nullable</span> forms of
  1289. the types <span class=CodeFragment>Single</span>, <span class=CodeFragment>Double</span>,
  1290. and <span class=CodeFragment>Decimal</span> are collectively called the <em><span
  1291. style='font-family:"Calibri","sans-serif"'>real types</span></em>.</p>
  1292. <p class=MsoNormal><a name=NumericTypes></a>The integral types and real types
  1293. are collectively called the <em><span style='font-family:"Calibri","sans-serif"'>numeric
  1294. types</span></em>.</p>
  1295. <h2><a name="_Conversions_1"></a><span style='mso-fareast-font-family:"Times New Roman"'>Conversions<o:p></o:p></span></h2>
  1296. <p class=MsoNormal>The following conversions are implicitly performed by the
  1297. expression language:</p>
  1298. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1299. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1300. </span><span class=GramE>From</span> the <span class=SpellE>the</span> <span
  1301. class=CodeFragment>null</span> literal to any reference type or <span
  1302. class=SpellE>nullable</span> type.</p>
  1303. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1304. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1305. </span><span class=GramE>From</span> an integer literal to an <a
  1306. href="#IntegralTypes">integral type</a> or <a href="#RealTypes">real type</a>
  1307. provided the number is within the range of that type.</p>
  1308. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1309. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1310. </span><span class=GramE>From</span> a real literal to a <a href="#RealTypes">real
  1311. type</a> provided the number is within the range of that type.</p>
  1312. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1313. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1314. </span><span class=GramE>From</span> a string literal to an <span class=SpellE>enum</span>
  1315. type provided the string literal contains the name of a member of that <span
  1316. class=SpellE>enum</span> type.</p>
  1317. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1318. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1319. </span><span class=GramE>From</span> a source type that is assignment
  1320. compatible with the target type according to the <span class=SpellE><span
  1321. class=CodeFragment>Type.IsAssignableFrom</span></span> method in .NET.</p>
  1322. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1323. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1324. </span><span class=GramE>From</span> a non-<span class=SpellE>nullable</span>
  1325. value type to the <span class=SpellE>nullable</span> form of that value type.</p>
  1326. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1327. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1328. </span><span class=GramE>From</span> a <a href="#NumericTypes">numeric type</a>
  1329. to another numeric type with greater range.</p>
  1330. <p class=MsoNormal>The expression language permits explicit conversions using
  1331. the syntax <span class=GramE><i>type</i><span class=CodeFragment>(</span></span><span
  1332. class=SpellE><i>expr</i></span><span class=CodeFragment>)</span>, where <i>type</i>
  1333. is a type name optionally followed by <span class=CodeFragment>?</span> <span
  1334. class=GramE>and</span> <span class=SpellE><i>expr</i></span> is an expression.
  1335. This syntax may be used to perform the following conversions:</p>
  1336. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1337. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1338. </span><span class=GramE>Between</span> two types provided <span class=SpellE><span
  1339. class=CodeFragment>Type.IsAssignableFrom</span></span> is true in one or both
  1340. directions.</p>
  1341. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1342. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1343. </span><span class=GramE>Between</span> two types provided one or both are
  1344. interface types.</p>
  1345. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1346. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1347. </span><span class=GramE>Between</span> the <span class=SpellE>nullable</span>
  1348. and non-<span class=SpellE>nullable</span> forms of any value type.</p>
  1349. <p class=MsoListParagraph style='text-indent:-.25in'><span style='font-family:
  1350. Symbol'>·</span><span style='font-size:7.0pt;line-height:115%;font-family:"Times New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1351. </span>Between any two types belonging to the set consisting of <span
  1352. class=SpellE><span class=CodeFragment>SByte</span></span>, <span
  1353. class=CodeFragment>Byte</span>, <span class=CodeFragment>Int16</span>, <span
  1354. class=CodeFragment>UInt16</span>, <span class=CodeFragment>Int32</span>, <span
  1355. class=CodeFragment>UInt32</span>, <span class=CodeFragment>Int64</span>, <span
  1356. class=CodeFragment>UInt64</span>, <span class=CodeFragment>Decimal</span>, <span
  1357. class=CodeFragment>Single</span>, <span class=CodeFragment>Double</span>, <span
  1358. class=CodeFragment>Char</span>, any <span class=SpellE>enum</span> type, as
  1359. well as the <span class=SpellE>nullable</span> forms of those types.</p>
  1360. <h2 style='line-height:150%'><span style='mso-fareast-font-family:"Times New Roman"'>Operators<o:p></o:p></span></h2>
  1361. <p class=MsoNormal>The table below shows the operators supported by the
  1362. expression language in order of precedence from highest to lowest. Operators in
  1363. the same category have equal precedence. In the table, <span
  1364. class=CodeFragment>x</span>, <span class=CodeFragment>y</span>, and <span
  1365. class=CodeFragment>z</span> denote expressions, <span class=CodeFragment>T</span>
  1366. denotes a <a href="#_Types">type</a>, and <span class=CodeFragment>m</span>
  1367. denotes a member.</p>
  1368. <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0
  1369. style='margin-left:.25in;border-collapse:collapse;mso-yfti-tbllook:1184;
  1370. mso-padding-alt:0in 0in 0in 0in'>
  1371. <thead>
  1372. <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
  1373. <td width=103 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1374. background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt'>
  1375. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1376. 3.0pt;margin-left:0in;line-height:normal'><b>Category</b></p>
  1377. </td>
  1378. <td width=108 valign=top style='width:81.0pt;border:solid black 1.0pt;
  1379. border-left:none;background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt'>
  1380. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1381. 3.0pt;margin-left:0in;line-height:normal'><b>Expression</b></p>
  1382. </td>
  1383. <td width=354 valign=top style='width:265.5pt;border:solid black 1.0pt;
  1384. border-left:none;background:#D9D9D9;padding:0in 5.4pt 0in 5.4pt'>
  1385. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1386. 3.0pt;margin-left:0in;line-height:normal'><b>Description</b></p>
  1387. </td>
  1388. </tr>
  1389. </thead>
  1390. <tr style='mso-yfti-irow:1'>
  1391. <td width=103 rowspan=10 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1392. border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  1393. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1394. 3.0pt;margin-left:0in;line-height:normal'>Primary</p>
  1395. </td>
  1396. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1397. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1398. padding:0in 5.4pt 0in 5.4pt'>
  1399. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1400. 3.0pt;margin-left:0in;line-height:normal'><span class=SpellE><span
  1401. class=CodeFragment>x.m</span></span></p>
  1402. </td>
  1403. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1404. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1405. padding:0in 5.4pt 0in 5.4pt'>
  1406. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1407. 3.0pt;margin-left:0in;line-height:normal'>Instance field or instance property
  1408. access. Any public field or property can be accessed.</p>
  1409. </td>
  1410. </tr>
  1411. <tr style='mso-yfti-irow:2'>
  1412. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1413. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1414. padding:0in 5.4pt 0in 5.4pt'>
  1415. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1416. 3.0pt;margin-left:0in;line-height:normal'><span class=SpellE><span
  1417. class=GramE><span class=CodeFragment>x.m</span></span></span><span
  1418. class=GramE><span class=CodeFragment>(</span></span><span class=CodeFragment>…)</span></p>
  1419. </td>
  1420. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1421. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1422. padding:0in 5.4pt 0in 5.4pt'>
  1423. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1424. 3.0pt;margin-left:0in;line-height:normal'>Instance <a
  1425. href="#_Constructor_and_Method">method invocation</a>. The method must be
  1426. public and must be declared in an <a href="#_Predefined_types">accessible
  1427. type</a>.</p>
  1428. </td>
  1429. </tr>
  1430. <tr style='mso-yfti-irow:3'>
  1431. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1432. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1433. padding:0in 5.4pt 0in 5.4pt'>
  1434. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1435. 3.0pt;margin-left:0in;line-height:normal'><span class=GramE><span
  1436. class=CodeFragment>x[</span></span><span class=CodeFragment>…]</span></p>
  1437. </td>
  1438. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1439. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1440. padding:0in 5.4pt 0in 5.4pt'>
  1441. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1442. 3.0pt;margin-left:0in;line-height:normal'>Array or indexer access.
  1443. Multi-dimensional arrays are not supported.</p>
  1444. </td>
  1445. </tr>
  1446. <tr style='mso-yfti-irow:4'>
  1447. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1448. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1449. padding:0in 5.4pt 0in 5.4pt'>
  1450. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1451. 3.0pt;margin-left:0in;line-height:normal'><span class=SpellE><span
  1452. class=CodeFragment>T.m</span></span></p>
  1453. </td>
  1454. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1455. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1456. padding:0in 5.4pt 0in 5.4pt'>
  1457. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1458. 3.0pt;margin-left:0in;line-height:normal'>Static field or static property
  1459. access. Any public field or property can be accessed.</p>
  1460. </td>
  1461. </tr>
  1462. <tr style='mso-yfti-irow:5'>
  1463. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1464. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1465. padding:0in 5.4pt 0in 5.4pt'>
  1466. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1467. 3.0pt;margin-left:0in;line-height:normal'><span class=SpellE><span
  1468. class=GramE><span class=CodeFragment>T.m</span></span></span><span
  1469. class=GramE><span class=CodeFragment>(</span></span><span class=CodeFragment>…)</span></p>
  1470. </td>
  1471. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1472. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1473. padding:0in 5.4pt 0in 5.4pt'>
  1474. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1475. 3.0pt;margin-left:0in;line-height:normal'>Static <a
  1476. href="#_Anonymous_Object_Creation">method invocation</a>. The method must be
  1477. public and must be declared in an <a href="#_Predefined_types">accessible
  1478. type</a>.</p>
  1479. </td>
  1480. </tr>
  1481. <tr style='mso-yfti-irow:6'>
  1482. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1483. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1484. padding:0in 5.4pt 0in 5.4pt'>
  1485. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1486. 3.0pt;margin-left:0in;line-height:normal'><span class=GramE><span
  1487. class=CodeFragment>T(</span></span><span class=CodeFragment>…)</span></p>
  1488. </td>
  1489. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1490. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1491. padding:0in 5.4pt 0in 5.4pt'>
  1492. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1493. 3.0pt;margin-left:0in;line-height:normal'><a href="#_Conversions">Explicit
  1494. conversion</a> or <a href="#_Anonymous_Object_Creation">constructor
  1495. invocation</a>. Note that <span class=CodeFragment>new</span> is not required
  1496. in front of a constructor invocation.</p>
  1497. </td>
  1498. </tr>
  1499. <tr style='mso-yfti-irow:7'>
  1500. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1501. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1502. padding:0in 5.4pt 0in 5.4pt'>
  1503. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1504. 3.0pt;margin-left:0in;line-height:normal'><span class=GramE><span
  1505. class=CodeFragment>new(</span></span><span class=CodeFragment>…)</span></p>
  1506. </td>
  1507. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1508. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1509. padding:0in 5.4pt 0in 5.4pt'>
  1510. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1511. 3.0pt;margin-left:0in;line-height:normal'><a href="#_Data_Object_Initializer">Data
  1512. object <span class=SpellE>initializer</span></a>. This construct can be used
  1513. to perform dynamic projections.</p>
  1514. </td>
  1515. </tr>
  1516. <tr style='mso-yfti-irow:8'>
  1517. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1518. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1519. padding:0in 5.4pt 0in 5.4pt'>
  1520. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1521. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>it</span></p>
  1522. </td>
  1523. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1524. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1525. padding:0in 5.4pt 0in 5.4pt'>
  1526. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1527. 3.0pt;margin-left:0in;line-height:normal'><a href="#_Current_Instance">Current
  1528. instance</a>. In contexts where members of a current object are implicitly in
  1529. scope, <span class=CodeFragment>it</span> is used to refer to the entire
  1530. object itself.</p>
  1531. </td>
  1532. </tr>
  1533. <tr style='mso-yfti-irow:9'>
  1534. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1535. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1536. padding:0in 5.4pt 0in 5.4pt'>
  1537. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1538. 3.0pt;margin-left:0in;line-height:normal'><span class=GramE><span
  1539. class=CodeFragment>x(</span></span><span class=CodeFragment>…)</span></p>
  1540. </td>
  1541. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1542. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1543. padding:0in 5.4pt 0in 5.4pt'>
  1544. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1545. 3.0pt;margin-left:0in;line-height:normal'><a
  1546. href="#_Dynamic_Expression_Invocation">Dynamic lambda invocation</a>. Used to
  1547. reference another dynamic lambda expression.</p>
  1548. </td>
  1549. </tr>
  1550. <tr style='mso-yfti-irow:10'>
  1551. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1552. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1553. padding:0in 5.4pt 0in 5.4pt'>
  1554. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1555. 3.0pt;margin-left:0in;line-height:normal'><span class=SpellE><span
  1556. class=CodeFragment>iif</span></span><span class=CodeFragment>(x,</span> <span
  1557. class=CodeFragment>y,</span> <span class=CodeFragment>z)</span></p>
  1558. </td>
  1559. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1560. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1561. padding:0in 5.4pt 0in 5.4pt'>
  1562. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1563. 3.0pt;margin-left:0in;line-height:normal'>Conditional expression. Alternate
  1564. syntax for <span class=GramE><span class=CodeFragment>x</span> <span
  1565. class=CodeFragment>?</span></span> <span class=CodeFragment>y</span> <span
  1566. class=CodeFragment>:</span> <span class=CodeFragment>z</span>.</p>
  1567. </td>
  1568. </tr>
  1569. <tr style='mso-yfti-irow:11'>
  1570. <td width=103 rowspan=2 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1571. border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  1572. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1573. 3.0pt;margin-left:0in;line-height:normal'>Unary</p>
  1574. </td>
  1575. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1576. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1577. padding:0in 5.4pt 0in 5.4pt'>
  1578. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1579. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>-x</span></p>
  1580. </td>
  1581. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1582. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1583. padding:0in 5.4pt 0in 5.4pt'>
  1584. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1585. 3.0pt;margin-left:0in;line-height:normal'>Negation. Supported types are <span
  1586. class=CodeFragment>Int32</span>, <span class=CodeFragment>Int64</span>, <span
  1587. class=CodeFragment>Decimal</span>, <span class=CodeFragment>Single</span>,
  1588. and <span class=CodeFragment>Double</span>.</p>
  1589. </td>
  1590. </tr>
  1591. <tr style='mso-yfti-irow:12'>
  1592. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1593. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1594. padding:0in 5.4pt 0in 5.4pt'>
  1595. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1596. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>!x</span></p>
  1597. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1598. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>not x</span></p>
  1599. </td>
  1600. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1601. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1602. padding:0in 5.4pt 0in 5.4pt'>
  1603. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1604. 3.0pt;margin-left:0in;line-height:normal'>Logical negation. Operand must be <span
  1605. class=GramE>of</span> type <span class=CodeFragment>Boolean</span>.</p>
  1606. </td>
  1607. </tr>
  1608. <tr style='mso-yfti-irow:13'>
  1609. <td width=103 rowspan=3 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1610. border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  1611. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1612. 3.0pt;margin-left:0in;line-height:normal'>Multiplicative</p>
  1613. </td>
  1614. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1615. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1616. padding:0in 5.4pt 0in 5.4pt'>
  1617. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1618. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x * y</span></p>
  1619. </td>
  1620. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1621. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1622. padding:0in 5.4pt 0in 5.4pt'>
  1623. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1624. 3.0pt;margin-left:0in;line-height:normal'>Multiplication. Supported types are
  1625. <span class=CodeFragment>Int32</span>, <span class=CodeFragment>UInt32</span>,
  1626. <span class=CodeFragment>Int64</span>, <span class=CodeFragment>UInt64</span>,
  1627. <span class=CodeFragment>Decimal</span>, <span class=CodeFragment>Single</span>,
  1628. and <span class=CodeFragment>Double</span>.</p>
  1629. </td>
  1630. </tr>
  1631. <tr style='mso-yfti-irow:14'>
  1632. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1633. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1634. padding:0in 5.4pt 0in 5.4pt'>
  1635. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1636. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x / y</span></p>
  1637. </td>
  1638. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1639. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1640. padding:0in 5.4pt 0in 5.4pt'>
  1641. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1642. 3.0pt;margin-left:0in;line-height:normal'>Division. Supported types are <span
  1643. class=CodeFragment>Int32</span>, <span class=CodeFragment>UInt32</span>, <span
  1644. class=CodeFragment>Int64</span>, <span class=CodeFragment>UInt64</span>, <span
  1645. class=CodeFragment>Decimal</span>, <span class=CodeFragment>Single</span>,
  1646. and <span class=CodeFragment>Double</span>.</p>
  1647. </td>
  1648. </tr>
  1649. <tr style='mso-yfti-irow:15'>
  1650. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1651. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1652. padding:0in 5.4pt 0in 5.4pt'>
  1653. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1654. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x % y</span></p>
  1655. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1656. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x mod y</span></p>
  1657. </td>
  1658. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1659. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1660. padding:0in 5.4pt 0in 5.4pt'>
  1661. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1662. 3.0pt;margin-left:0in;line-height:normal'>Remainder. Supported types are <span
  1663. class=CodeFragment>Int32</span>, <span class=CodeFragment>UInt32</span>, <span
  1664. class=CodeFragment>Int64</span>, <span class=CodeFragment>UInt64</span>, <span
  1665. class=CodeFragment>Decimal</span>, <span class=CodeFragment>Single</span>,
  1666. and <span class=CodeFragment>Double</span>.</p>
  1667. </td>
  1668. </tr>
  1669. <tr style='mso-yfti-irow:16'>
  1670. <td width=103 rowspan=3 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1671. border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  1672. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1673. 3.0pt;margin-left:0in;line-height:normal'>Additive</p>
  1674. </td>
  1675. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1676. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1677. padding:0in 5.4pt 0in 5.4pt'>
  1678. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1679. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x + y</span></p>
  1680. </td>
  1681. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1682. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1683. padding:0in 5.4pt 0in 5.4pt'>
  1684. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1685. 3.0pt;margin-left:0in;line-height:normal'>Addition or string concatenation.
  1686. Performs string concatenation if either operand is of type <span
  1687. class=CodeFragment>String</span>. Otherwise, performs addition for the
  1688. supported types <span class=CodeFragment>Int32</span>, <span
  1689. class=CodeFragment>UInt32</span>, <span class=CodeFragment>Int64</span>, <span
  1690. class=CodeFragment>UInt64</span>, <span class=CodeFragment>Decimal</span>, <span
  1691. class=CodeFragment>Single</span>, <span class=CodeFragment>Double</span>, <span
  1692. class=SpellE><span class=CodeFragment>DateTime</span></span>, and <span
  1693. class=SpellE><span class=CodeFragment>TimeSpan</span></span>.</p>
  1694. </td>
  1695. </tr>
  1696. <tr style='mso-yfti-irow:17'>
  1697. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1698. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1699. padding:0in 5.4pt 0in 5.4pt'>
  1700. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1701. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x – y</span></p>
  1702. </td>
  1703. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1704. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1705. padding:0in 5.4pt 0in 5.4pt'>
  1706. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1707. 3.0pt;margin-left:0in;line-height:normal'>Subtraction. Supported types are <span
  1708. class=CodeFragment>Int32</span>, <span class=CodeFragment>UInt32</span>, <span
  1709. class=CodeFragment>Int64</span>, <span class=CodeFragment>UInt64</span>, <span
  1710. class=GramE><span class=CodeFragment>Decimal</span></span>, <span
  1711. class=CodeFragment>Single</span>, <span class=CodeFragment>Double</span>, <span
  1712. class=SpellE><span class=CodeFragment>DateTime</span></span>, and <span
  1713. class=SpellE><span class=CodeFragment>TimeSpan</span></span>.</p>
  1714. </td>
  1715. </tr>
  1716. <tr style='mso-yfti-irow:18'>
  1717. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1718. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1719. padding:0in 5.4pt 0in 5.4pt'>
  1720. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1721. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x &amp; y</span></p>
  1722. </td>
  1723. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1724. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1725. padding:0in 5.4pt 0in 5.4pt'>
  1726. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1727. 3.0pt;margin-left:0in;line-height:normal'>String concatenation. Operands may
  1728. be of any type.</p>
  1729. </td>
  1730. </tr>
  1731. <tr style='mso-yfti-irow:19'>
  1732. <td width=103 rowspan=6 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1733. border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  1734. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1735. 3.0pt;margin-left:0in;line-height:normal'>Relational</p>
  1736. </td>
  1737. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1738. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1739. padding:0in 5.4pt 0in 5.4pt'>
  1740. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1741. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x = y</span></p>
  1742. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1743. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x == y</span></p>
  1744. </td>
  1745. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1746. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1747. padding:0in 5.4pt 0in 5.4pt'>
  1748. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1749. 3.0pt;margin-left:0in;line-height:normal'>Equal. Supported for reference
  1750. types and the <a href="#_Predefined_types">primitive types</a>. Assignment is
  1751. not supported.</p>
  1752. </td>
  1753. </tr>
  1754. <tr style='mso-yfti-irow:20'>
  1755. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1756. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1757. padding:0in 5.4pt 0in 5.4pt'>
  1758. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1759. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x != y</span></p>
  1760. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1761. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x &lt;&gt;
  1762. y</span></p>
  1763. </td>
  1764. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1765. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1766. padding:0in 5.4pt 0in 5.4pt'>
  1767. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1768. 3.0pt;margin-left:0in;line-height:normal'>Not equal. Supported for reference
  1769. types and the <a href="#_Predefined_types">primitive types</a>.</p>
  1770. </td>
  1771. </tr>
  1772. <tr style='mso-yfti-irow:21'>
  1773. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1774. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1775. padding:0in 5.4pt 0in 5.4pt'>
  1776. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1777. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x &lt; y</span></p>
  1778. </td>
  1779. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1780. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1781. padding:0in 5.4pt 0in 5.4pt'>
  1782. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1783. 3.0pt;margin-left:0in;line-height:normal'>Less than. Supported for all <a
  1784. href="#_Predefined_types">primitive types</a> except <span
  1785. class=CodeFragment>Boolean</span>, <span class=CodeFragment>Object</span> and
  1786. <span class=SpellE><span class=CodeFragment>Guid</span></span>.</p>
  1787. </td>
  1788. </tr>
  1789. <tr style='mso-yfti-irow:22'>
  1790. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1791. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1792. padding:0in 5.4pt 0in 5.4pt'>
  1793. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1794. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x &gt; y</span></p>
  1795. </td>
  1796. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1797. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1798. padding:0in 5.4pt 0in 5.4pt'>
  1799. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1800. 3.0pt;margin-left:0in;line-height:normal'>Greater than. Supported for all <a
  1801. href="#_Predefined_types">primitive types</a> except <span
  1802. class=CodeFragment>Boolean</span>, <span class=CodeFragment>Object</span> and
  1803. <span class=SpellE><span class=CodeFragment>Guid</span></span>.</p>
  1804. </td>
  1805. </tr>
  1806. <tr style='mso-yfti-irow:23'>
  1807. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1808. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1809. padding:0in 5.4pt 0in 5.4pt'>
  1810. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1811. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x &lt;= y</span></p>
  1812. </td>
  1813. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1814. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1815. padding:0in 5.4pt 0in 5.4pt'>
  1816. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1817. 3.0pt;margin-left:0in;line-height:normal'>Less than or equal. Supported for
  1818. all <a href="#_Predefined_types">primitive types</a> except <span
  1819. class=CodeFragment>Boolean</span>, <span class=CodeFragment>Object</span> and
  1820. <span class=SpellE><span class=CodeFragment>Guid</span></span>.</p>
  1821. </td>
  1822. </tr>
  1823. <tr style='mso-yfti-irow:24'>
  1824. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1825. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1826. padding:0in 5.4pt 0in 5.4pt'>
  1827. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1828. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x &gt;= y</span></p>
  1829. </td>
  1830. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1831. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1832. padding:0in 5.4pt 0in 5.4pt'>
  1833. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1834. 3.0pt;margin-left:0in;line-height:normal'>Greater than or equal. Supported
  1835. for all <a href="#_Predefined_types">primitive types</a> except <span
  1836. class=CodeFragment>Boolean</span>, <span class=CodeFragment>Object</span> and
  1837. <span class=SpellE><span class=CodeFragment>Guid</span></span>.</p>
  1838. </td>
  1839. </tr>
  1840. <tr style='mso-yfti-irow:25'>
  1841. <td width=103 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1842. border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  1843. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1844. 3.0pt;margin-left:0in;line-height:normal'>Logical AND</p>
  1845. </td>
  1846. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1847. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1848. padding:0in 5.4pt 0in 5.4pt'>
  1849. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1850. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x
  1851. &amp;&amp; y</span></p>
  1852. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1853. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x and y</span></p>
  1854. </td>
  1855. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1856. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1857. padding:0in 5.4pt 0in 5.4pt'>
  1858. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1859. 3.0pt;margin-left:0in;line-height:normal'>Logical AND. Operands must be <span
  1860. class=GramE>of</span> type <span class=CodeFragment>Boolean</span>.</p>
  1861. </td>
  1862. </tr>
  1863. <tr style='mso-yfti-irow:26'>
  1864. <td width=103 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1865. border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  1866. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1867. 3.0pt;margin-left:0in;line-height:normal'>Logical OR</p>
  1868. </td>
  1869. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1870. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1871. padding:0in 5.4pt 0in 5.4pt'>
  1872. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1873. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x || y</span></p>
  1874. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1875. 3.0pt;margin-left:0in;line-height:normal'><span class=CodeFragment>x or y</span></p>
  1876. </td>
  1877. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1878. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1879. padding:0in 5.4pt 0in 5.4pt'>
  1880. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1881. 3.0pt;margin-left:0in;line-height:normal'>Logical OR. Operands must be <span
  1882. class=GramE>of</span> type <span class=CodeFragment>Boolean</span>.</p>
  1883. </td>
  1884. </tr>
  1885. <tr style='mso-yfti-irow:27;mso-yfti-lastrow:yes'>
  1886. <td width=103 valign=top style='width:77.4pt;border:solid black 1.0pt;
  1887. border-top:none;padding:0in 5.4pt 0in 5.4pt'>
  1888. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1889. 3.0pt;margin-left:0in;line-height:normal'>Conditional</p>
  1890. </td>
  1891. <td width=108 valign=top style='width:81.0pt;border-top:none;border-left:
  1892. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1893. padding:0in 5.4pt 0in 5.4pt'>
  1894. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1895. 3.0pt;margin-left:0in;line-height:normal'><span class=GramE><span
  1896. class=CodeFragment>x ?</span></span><span class=CodeFragment> y : z</span></p>
  1897. </td>
  1898. <td width=354 valign=top style='width:265.5pt;border-top:none;border-left:
  1899. none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
  1900. padding:0in 5.4pt 0in 5.4pt'>
  1901. <p class=MsoNormal style='margin-top:3.0pt;margin-right:0in;margin-bottom:
  1902. 3.0pt;margin-left:0in;line-height:normal'>Evaluates <span class=CodeFragment>y</span>
  1903. if <span class=CodeFragment>x</span> is true, evaluates <span
  1904. class=CodeFragment>z</span> if <span class=CodeFragment>x</span> is false.</p>
  1905. </td>
  1906. </tr>
  1907. </table>
  1908. <h2><a name="_Anonymous_Object_Creation"></a><a name="_Constructor_and_Method"></a><span
  1909. style='mso-fareast-font-family:"Times New Roman"'>Method and Constructor
  1910. Invocations<o:p></o:p></span></h2>
  1911. <p class=MsoNormal>The expression language limits invocation of methods and
  1912. constructors to those declared public in the <a href="#_Predefined_types">accessible
  1913. types</a>. This restriction exists to protect against unintended side effects
  1914. from invocation of arbitrary methods.</p>
  1915. <p class=MsoNormal>The expression language permits getting (but not setting)
  1916. the value of any reachable public field, property, or indexer.</p>
  1917. <p class=MsoNormal>Overload resolution for methods, constructors, and indexers
  1918. uses rules similar to C#. In informal terms, overload resolution will pick the
  1919. best matching method, constructor, or indexer, or report an ambiguity error if
  1920. no single best match can be identified.</p>
  1921. <p class=MsoNormal>Note that constructor invocations are not prefixed by <span
  1922. class=CodeFragment>new</span>. The following example creates a <span
  1923. class=SpellE><span class=CodeFragment>DateTime</span></span> instance for a <span
  1924. class=SpellE>specfic</span> year, month, and day using a constructor
  1925. invocation:</p>
  1926. <p class=Code><span class=SpellE><span class=GramE>orders.Where</span></span><span
  1927. class=GramE>(</span><span style='color:#A31515'>&quot;<span class=SpellE>OrderDate</span>
  1928. &gt;= <span class=SpellE>DateTime</span>(2007, 1, 1)&quot;</span>);</p>
  1929. <h2><a name="_Anonymous_Object_Initializer"></a><a
  1930. name="_Data_Object_Initializer"></a><span style='mso-fareast-font-family:"Times New Roman"'>Data
  1931. Object Initializers<o:p></o:p></span></h2>
  1932. <p class=MsoNormal>A data object <span class=SpellE>initializer</span> creates
  1933. a <a href="#_Dynamic_Data_Classes">data class</a> and returns an instance of
  1934. that class. The properties of the data class are inferred from the data object <span
  1935. class=SpellE>initializer</span>. Specifically, a data object <span
  1936. class=SpellE>initializer</span> of the form</p>
  1937. <p class=Code><span class=GramE>new(</span>e1 as p1, e2 as p2, e3 as p3)</p>
  1938. <p class=MsoNormal><span class=GramE>creates</span> a data class with three
  1939. properties, <span class=CodeFragment>p1</span>, <span class=CodeFragment>p2</span>,
  1940. and <span class=CodeFragment>p3</span>, the types of which are inferred from
  1941. the expressions <span class=CodeFragment>e1</span>, <span class=CodeFragment>e2</span>,
  1942. and <span class=CodeFragment>e3</span>, and returns an instance of that data
  1943. class with the properties initialized to the values computed by <span
  1944. class=CodeFragment>e1</span>, <span class=CodeFragment>e2</span>, and <span
  1945. class=CodeFragment>e3</span>. A property <span class=SpellE>initializer</span>
  1946. may omit the <span class=CodeFragment>as</span> keyword and the property name
  1947. provided the associated expression is a field or property access. The example</p>
  1948. <p class=Code><span class=SpellE><span class=GramE>customers.Select</span></span><span
  1949. class=GramE>(</span><span style='color:#A31515'>&quot;new(<span class=SpellE>CompanyName</span>
  1950. as Name, Phone)&quot;</span>);</p>
  1951. <p class=MsoNormal><span class=GramE>creates</span> a data class with two
  1952. properties, <span class=CodeFragment>Name</span> and <span class=CodeFragment>Phone</span>,
  1953. and returns a sequence of instances of that data class initialized from the <span
  1954. class=SpellE><span class=CodeFragment>CompanyName</span></span> and <span
  1955. class=CodeFragment>Phone</span> properties of each customer.</p>
  1956. <h2><a name="_Current_Instance"></a><span style='mso-fareast-font-family:"Times New Roman"'>Current
  1957. Instance<o:p></o:p></span></h2>
  1958. <p class=MsoNormal>When parsing a lambda expression with a single unnamed
  1959. parameter, the members of the unnamed parameter are automatically in scope in
  1960. the expression string, and the <a href="#_Current_Instance"><em><span
  1961. style='font-family:"Calibri","sans-serif";color:windowtext;text-decoration:
  1962. none;text-underline:none'>current instance</span></em></a> given by the unnamed
  1963. parameter can be referenced in whole using the keyword <span
  1964. class=CodeFragment>it</span>. For example,</p>
  1965. <p class=Code><span class=SpellE><span class=GramE>customers.Where</span></span><span
  1966. class=GramE>(</span><span style='color:#A31515'>&quot;Country = @0&quot;</span>,
  1967. country);</p>
  1968. <p class=MsoNormal><span class=GramE>is</span> equivalent to</p>
  1969. <p class=Code><span class=SpellE><span class=GramE>customers.Where</span></span><span
  1970. class=GramE>(</span><span style='color:#A31515'>&quot;<span class=SpellE>it.Country</span>
  1971. = @0&quot;</span>, country);</p>
  1972. <p class=MsoNormal>The <a href="#_IQueryable_Extension_Methods">IQueryable
  1973. extension methods</a> all parse their expression arguments as lambda
  1974. expressions with a single unnamed parameter.</p>
  1975. <h2><a name="_Dynamic_Expression_Invocation"></a><span style='mso-fareast-font-family:
  1976. "Times New Roman"'>Dynamic Lambda Invocation<o:p></o:p></span></h2>
  1977. <p class=MsoNormal>An expression can reference other dynamic lambda expressions
  1978. through <em><span style='font-family:"Calibri","sans-serif"'>dynamic lambda
  1979. invocations</span></em>. A dynamic lambda invocation consists of a substitution
  1980. variable identifier that references an instance of <span class=SpellE><span
  1981. class=CodeFragment>System.Linq.Expressions.LambdaExpression</span></span>,
  1982. followed by an argument list. The arguments supplied must be compatible with
  1983. the parameter list of the given dynamic lambda expression.</p>
  1984. <p class=MsoNormal>The following parses two separate dynamic lambda expressions
  1985. and then combines them in a predicate expression through dynamic lambda
  1986. invocations:</p>
  1987. <p class=Code><span style='color:#2B91AF'>Expression</span>&lt;<span
  1988. class=SpellE><span style='color:#2B91AF'>Func</span></span>&lt;<span
  1989. style='color:#2B91AF'>Customer</span>, <span class=SpellE><span
  1990. style='color:blue'>bool</span></span>&gt;&gt; e1 = <br>
  1991. &nbsp;&nbsp;&nbsp; <span class=SpellE><span style='color:#2B91AF'>DynamicExpression</span>.ParseLambda</span>&lt;<span
  1992. style='color:#2B91AF'>Customer</span>, <span class=SpellE><span
  1993. style='color:blue'>bool</span></span><span class=GramE>&gt;(</span><span
  1994. style='color:#A31515'>&quot;City = \&quot;London\&quot;&quot;</span>);<br>
  1995. <span style='color:#2B91AF'>Expression</span>&lt;<span class=SpellE><span
  1996. style='color:#2B91AF'>Func</span></span>&lt;<span style='color:#2B91AF'>Customer</span>,
  1997. <span class=SpellE><span style='color:blue'>bool</span></span>&gt;&gt; e2 =<br>
  1998. &nbsp;&nbsp;&nbsp; <span class=SpellE><span style='color:#2B91AF'>DynamicExpression</span>.ParseLambda</span>&lt;<span
  1999. style='color:#2B91AF'>Customer</span>, <span class=SpellE><span
  2000. style='color:blue'>bool</span></span>&gt;(<span style='color:#A31515'>&quot;<span
  2001. class=SpellE>Orders.Count</span> &gt;= 10&quot;</span>);<br>
  2002. <span style='color:#2B91AF'>IQueryable</span>&lt;<span style='color:#2B91AF'>Customer</span>&gt;
  2003. query =<br>
  2004. &nbsp;&nbsp;&nbsp; <span class=SpellE>db.Customers.Where</span>(<span
  2005. style='color:#A31515'>&quot;@0(it) and @1(it)&quot;</span>, e1, e2);</p>
  2006. <p class=MsoNormal>It is of course possible to combine static and dynamic
  2007. lambda expressions in this fashion:</p>
  2008. <p class=Code><span style='color:#2B91AF'>Expression</span>&lt;<span
  2009. class=SpellE><span style='color:#2B91AF'>Func</span></span>&lt;<span
  2010. style='color:#2B91AF'>Customer</span>, <span class=SpellE><span
  2011. style='color:blue'>bool</span></span>&gt;&gt; e1 =<br>
  2012. &nbsp;&nbsp;&nbsp; c =&gt; <span class=SpellE>c.City</span> == <span
  2013. style='color:#A31515'>&quot;London&quot;</span><span class=GramE>;</span><br>
  2014. <span style='color:#2B91AF'>Expression</span>&lt;<span class=SpellE><span
  2015. style='color:#2B91AF'>Func</span></span>&lt;<span style='color:#2B91AF'>Customer</span>,
  2016. <span class=SpellE><span style='color:blue'>bool</span></span>&gt;&gt; e2 =<br>
  2017. &nbsp;&nbsp;&nbsp; <span class=SpellE><span style='color:#2B91AF'>DynamicExpression</span>.ParseLambda</span>&lt;<span
  2018. style='color:#2B91AF'>Customer</span>, <span class=SpellE><span
  2019. style='color:blue'>bool</span></span>&gt;(<span style='color:#A31515'>&quot;<span
  2020. class=SpellE>Orders.Count</span> &gt;= 10&quot;</span>);<br>
  2021. <span style='color:#2B91AF'>IQueryable</span>&lt;<span style='color:#2B91AF'>Customer</span>&gt;
  2022. query =<br>
  2023. &nbsp;&nbsp;&nbsp; <span class=SpellE>db.Customers.Where</span>(<span
  2024. style='color:#A31515'>&quot;@0(it) and @1(it)&quot;</span>, e1, e2);</p>
  2025. <p class=MsoNormal>The examples above both have the same effect as:</p>
  2026. <p class=Code><span style='color:#2B91AF'>IQueryable</span>&lt;<span
  2027. style='color:#2B91AF'>Customer</span>&gt; query =<br>
  2028. &nbsp;&nbsp;&nbsp; <span class=SpellE>db.Customers.Where</span>(c =&gt; <span
  2029. class=SpellE>c.City</span> == <span style='color:#A31515'>&quot;London&quot;</span>
  2030. &amp;&amp; <span class=SpellE>c.Orders.Count</span> &gt;= 10)<span class=GramE>;<span
  2031. style='display:none;mso-hide:all'>n</span></span><span style='display:none;
  2032. mso-hide:all'> a predicate expression c lambda expressions and then combines
  2033. them through dynamic lambda invocations</span></p>
  2034. <h2><span class=GramE><span style='mso-fareast-font-family:"Times New Roman";
  2035. display:none;mso-hide:all'>combines</span></span><span style='mso-fareast-font-family:
  2036. "Times New Roman";display:none;mso-hide:all'> two <span class=SpellE>seperately</span>
  2037. parsed lambda expressions in a single <span class=SpellE>predicate:e</span>
  2038. dynamic lambda expression. <span class=SpellE>System.Linq.Expressions.Lam<span
  2039. style='mso-hide:none'>Sequence</span></span></span><span style='mso-fareast-font-family:
  2040. "Times New Roman"'> operators<o:p></o:p></span></h2>
  2041. <p class=MsoNormal>A subset of the Standard Query Operators is supported for
  2042. objects that implement <span class=SpellE><span class=CodeFragment>IEnumerable</span></span><span
  2043. class=CodeFragment>&lt;T&gt;</span>. Specifically, the following constructs are
  2044. permitted, where <span class=SpellE><i>seq</i></span> is an <span class=SpellE><span
  2045. class=CodeFragment>IEnumerable</span></span><span class=CodeFragment>&lt;T&gt;</span>
  2046. instance, <i>predicate</i> is a <span class=SpellE><span class=GramE>boolean</span></span>
  2047. expression, and <i>selector</i> is an expression of any type:</p>
  2048. <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span
  2049. class=GramE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span></span><span
  2050. class=GramE> <span class=CodeFragment>.</span></span> <span class=CodeFragment>Where</span>
  2051. <span class=GramE><span class=CodeFragment>(</span> <em><span style='font-family:
  2052. "Calibri","sans-serif"'>predicate</span></em></span> <span class=CodeFragment>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2053. <span class=SpellE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span>
  2054. <span class=CodeFragment>.</span> <span class=CodeFragment>Any</span> <span
  2055. class=CodeFragment>(</span> <span class=CodeFragment>)</span></p>
  2056. <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span
  2057. class=GramE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span></span><span
  2058. class=GramE> <span class=CodeFragment>.</span></span> <span class=CodeFragment>Any</span>
  2059. <span class=GramE><span class=CodeFragment>(</span> <em><span style='font-family:
  2060. "Calibri","sans-serif"'>predicate</span></em></span> <span class=CodeFragment>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2061. <span class=SpellE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span>
  2062. <span class=CodeFragment>.</span> <span class=CodeFragment>All</span> <span
  2063. class=GramE><span class=CodeFragment>(</span> <em><span style='font-family:
  2064. "Calibri","sans-serif"'>predicate</span></em></span> )</p>
  2065. <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span
  2066. class=GramE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span></span><span
  2067. class=GramE> <span class=CodeFragment>.</span></span> <span class=CodeFragment>Count</span>
  2068. <span class=CodeFragment>(</span> <span class=CodeFragment>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2069. <span class=SpellE><span class=GramE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span></span><span
  2070. class=GramE> <span class=CodeFragment>.</span></span> <span class=CodeFragment>Count</span>
  2071. <span class=GramE><span class=CodeFragment>(</span> <em><span style='font-family:
  2072. "Calibri","sans-serif"'>predicate</span></em></span> <span class=CodeFragment>)</span></p>
  2073. <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span
  2074. class=GramE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span></span><span
  2075. class=GramE> <span class=CodeFragment>.</span></span> <span class=CodeFragment>Min</span>
  2076. <span class=GramE><span class=CodeFragment>(</span> <em><span style='font-family:
  2077. "Calibri","sans-serif"'>selector</span></em></span> <span class=CodeFragment>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2078. <span class=SpellE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span>
  2079. <span class=CodeFragment>.</span> <span class=CodeFragment>Max</span> <span
  2080. class=GramE><span class=CodeFragment>(</span> <em><span style='font-family:
  2081. "Calibri","sans-serif"'>selector</span></em></span> <span class=CodeFragment>)</span></p>
  2082. <p class=MsoNormal style='margin-left:.5in'><span class=SpellE><span
  2083. class=GramE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span></span><span
  2084. class=GramE> <span class=CodeFragment>.</span></span> <span class=CodeFragment>Sum</span>
  2085. <span class=GramE><span class=CodeFragment>(</span> <em><span style='font-family:
  2086. "Calibri","sans-serif"'>selector</span></em></span> <span class=CodeFragment>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  2087. <span class=SpellE><em><span style='font-family:"Calibri","sans-serif"'>seq</span></em></span>
  2088. <span class=CodeFragment>.</span> <span class=CodeFragment>Average</span> <span
  2089. class=GramE><span class=CodeFragment>(</span> <em><span style='font-family:
  2090. "Calibri","sans-serif"'>selector</span></em></span> <span class=CodeFragment>)</span></p>
  2091. <p class=MsoNormal>In the <i>predicate</i> and <i>selector</i> expressions, the
  2092. members of the <a href="#_Current_Instance">current instance</a> for that
  2093. sequence operator are automatically in scope, and the instance itself can be
  2094. referenced using the keyword <span class=CodeFragment>it</span>. An example:</p>
  2095. <p class=Code><span class=SpellE><span class=GramE>customers.Where</span></span><span
  2096. class=GramE>(</span><span style='color:#A31515'>&quot;<span class=SpellE>Orders.Any</span>(Total
  2097. &gt;= 1000)&quot;</span>);</p>
  2098. <h2><span class=SpellE><span style='mso-fareast-font-family:"Times New Roman"'>Enum</span></span><span
  2099. style='mso-fareast-font-family:"Times New Roman"'> type support<o:p></o:p></span></h2>
  2100. <p class=MsoNormal>The expression language supports an <a href="#_Conversions_1">implicit
  2101. conversion</a> from a string literal to an <span class=SpellE>enum</span> type
  2102. provided the string literal contains the name of a member of that <span
  2103. class=SpellE>enum</span> type. For example,</p>
  2104. <p class=Code><span class=SpellE><span class=GramE>orders.Where</span></span><span
  2105. class=GramE>(</span><span style='color:#A31515'>&quot;<span class=SpellE>OrderDate.DayOfWeek</span>
  2106. = \&quot;Monday\&quot;&quot;</span>);</p>
  2107. <p class=MsoNormal><span class=GramE>is</span> equivalent to</p>
  2108. <p class=Code><span class=SpellE><span class=GramE>orders.Where</span></span><span
  2109. class=GramE>(</span><span style='color:#A31515'>&quot;<span class=SpellE>OrderDate.DayOfWeek</span>
  2110. = @0&quot;</span>, <span class=SpellE><span style='color:#2B91AF'>DayOfWeek</span>.Monday</span>);</p>
  2111. <p class=MsoNormal>&nbsp;</p>
  2112. </div>
  2113. </body>
  2114. </html>