Upload
credera
View
1.217
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
Chander Dhall
Microsoft MVP
A type that defines a method signature
Delegates – WHAT?
Function pointers but type safe
Delegates – WHAT?
Allow methods to be passed as
parameters
Delegates – WHAT?
Can be chained together
Delegates – WHAT?
Decoupling Code
Delegates – WHY?
Methods as Parameters
Delegates – WHY?
Muli-casting NOT Multi-tasking
Delegates – WHY?
Callbacks and Event Handlers
Delegates – WHY?
LINQ
Delegates – WHY?
I can find all this online
Why do I attend your talk?
How to implement?
Where to implement?
How to implement right?
Demo
Expression Trees
Reference executable code
Expression Trees
References executable code
Form of Data structure
Expression Trees
Expression
Lambda
Expression
Binary
Expression
Expression
<Tdelegate>
Constant
Expression etc
Linq To Objects
C# code with
lambdaIL using delegates Results
Linq To Objects
C# code with
lambda
IL using
expression treesDynamic Sql
To
SQ
L p
rovid
er
Results
Immutable so cacheable
Expression Trees
Composable to complex behavior
Expression Trees
Compiled to delegate JITed to native code
Expression Trees