SlideShare a Scribd company logo
1 of 19
Expression Tree

     drake
Expression
•   3
•   a
•   !a
•   a+b
•   Math.Sin(a)
•   new StringBuilder()
Expression
•   3 ConstantExpression
•   aParameterExpression
•   !aUnaryExpression
•   a+bBinaryExpression
•   Math.Sin(a)MethodCallExpression
•   new StringBuilder()NewExpression
Summary
• 運算式的一個重要的特點就是它可以無限
  地組合,只要符合正確的類型和語義
• + 可以用於各類數數值型別的加法,那麼加
  號的左右就可以是任何類型為相應數值的
  表達式
Example
• a+2+3
• (a + 2) => b, (b+3)
Example
• Math.Sin(a) + 3
Expression
• System.Linq.Expressions
  1+2+3
Usage
System.Linq.Expressions.Expression
Expressioin
• Math.Sin(a)
Usage
Lambda Expression
• (parameters) => expression
Usage
InvocationExpression
Usage
Expression.OrElse Method
Usage
Using PredicateBuilder
PredicateBuilder Source Code
• Thank you for your listening!

More Related Content

More from LearningTech

More from LearningTech (20)

vim
vimvim
vim
 
PostCss
PostCssPostCss
PostCss
 
ReactJs
ReactJsReactJs
ReactJs
 
Docker
DockerDocker
Docker
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
node.js errors
node.js errorsnode.js errors
node.js errors
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
 
Expression tree
Expression treeExpression tree
Expression tree
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
flexbox report
flexbox reportflexbox report
flexbox report
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
Reflection & activator
Reflection & activatorReflection & activator
Reflection & activator
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
 
Node child process
Node child processNode child process
Node child process
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Expression tree
Expression treeExpression tree
Expression tree
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
git command
git commandgit command
git command
 

expression tree

Editor's Notes

  1. NewArrayExpression, ConditionExpression
  2. http://msdn.microsoft.com/en-us/library/bb506649.aspx
  3. http://www.albahari.com/nutshell/predicatebuilder.aspx