SlideShare a Scribd company logo
Microsoft MVP




                Chander Dhall
Delegates – WHAT?




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 – WHY?




  Decoupling Code
Delegates – WHY?




  Methods as Parameters
Delegates – WHY?




Muli-casting NOT Multi-tasking
Delegates – WHY?




Callbacks and Event Handlers
Delegates – WHY?




         LINQ
How to implement right?

  I can find all this online
      Where to implement?
Why do I attend your talk? 
     How to implement?
Demo
Expression Trees




Reference executable code
Expression Trees
        Form of Data structure




References executable code
Expression Trees

                 Expression



 Lambda            Binary         Constant
Expression       Expression     Expression etc



 Expression
<Tdelegate>
Linq To Objects




C# code with
                 IL using delegates   Results
  lambda
Linq To Objects




C# code with         IL using
                                    Dynamic Sql
  lambda         expression trees




                                       Results
Expression Trees




 Immutable so cacheable
Expression Trees




Composable to complex behavior
Expression Trees




Compiled to delegate JITed to native code

More Related Content

PPTX
Road to Dynamic LINQ - Part 2
PPTX
Road to Dynamic LINQ Part 1
PPTX
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
PDF
Kotlin & arrow: the functional way
PDF
Kotlin & Arrow the functional way
PDF
Internal domain-specific languages
PDF
Domain driven design and model driven development
PPTX
[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...
Road to Dynamic LINQ - Part 2
Road to Dynamic LINQ Part 1
Exploring C# DSLs: LINQ, Fluent Interfaces and Expression Trees
Kotlin & arrow: the functional way
Kotlin & Arrow the functional way
Internal domain-specific languages
Domain driven design and model driven development
[CB16] Be a Binary Rockstar: An Introduction to Program Analysis with Binary ...

What's hot (10)

PDF
MongoDB World 2018: A Swift Introduction to Swift
PPT
Utilize Jericho HTML Parser to Resolve NCR Problem
PDF
Tech Talk - Things I Learned at Scala Days 2013
PPTX
DDD - What, why, how?
PPTX
Introduction of lambda expression and predicate builder
PPTX
Introduction to Functional programming
PPT
Lambdas
PDF
Language Engineering With Xtext
PDF
How does intellisense work?
KEY
Jsx language-notes
MongoDB World 2018: A Swift Introduction to Swift
Utilize Jericho HTML Parser to Resolve NCR Problem
Tech Talk - Things I Learned at Scala Days 2013
DDD - What, why, how?
Introduction of lambda expression and predicate builder
Introduction to Functional programming
Lambdas
Language Engineering With Xtext
How does intellisense work?
Jsx language-notes
Ad

Similar to From delegates, to lamdas and expression trees your guide to elegant code in c#.net 4.0 (20)

PPTX
Evolve Your Code
PPTX
Fun with lambda expressions
DOCX
Project_Report (BARC-Jerin)_final
PPTX
Fun with lambda expressions
ODP
Can't Dance The Lambda
PPT
C#3.0 & Vb 9.0 New Features
PPTX
PDF
Day02 01 Advance Feature in C# DH TDT
PPTX
PDF
New c sharp3_features_(linq)_part_ii
PPTX
C# Delegates
PPTX
Delegates and events
PPT
Of Lambdas and LINQ
PPTX
Delegetes in c#
PPTX
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
PPTX
SQL Saturday 28 - .NET Fundamentals
PPTX
Evolution of C# delegates
DOCX
C# Unit 1 notes
PPTX
Visual Basic User Interface -IV
Evolve Your Code
Fun with lambda expressions
Project_Report (BARC-Jerin)_final
Fun with lambda expressions
Can't Dance The Lambda
C#3.0 & Vb 9.0 New Features
Day02 01 Advance Feature in C# DH TDT
New c sharp3_features_(linq)_part_ii
C# Delegates
Delegates and events
Of Lambdas and LINQ
Delegetes in c#
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
SQL Saturday 28 - .NET Fundamentals
Evolution of C# delegates
C# Unit 1 notes
Visual Basic User Interface -IV
Ad

More from Credera (15)

PPTX
Credera Employees Compete in AT&T Business Hackathon with Magic Leap
PDF
Seven Keys to Unlock and Lead Innovation Strategy
PDF
Credera 2017 Chief Marketing Officer survey
PPTX
Enterprise Social Networking: Strategy and Implementation with SharePoint 2013
PPTX
SharePoint Information Architecture
PPTX
Office 365 Migration Planning
PDF
UX Kick Start: Start Your Project Off On the Right Foot
PPTX
Agile Comes To You
PDF
SharePoint Commerce Services
PDF
Microsoft Cloud Services - Introducing the Value of BPOS
PDF
Microsoft X
PDF
JQuery and WCF for a Better User Experience
PDF
Open Admin - GWT
PDF
Aspnet mvc vs_web_forms_final
PDF
Winning With APIs
Credera Employees Compete in AT&T Business Hackathon with Magic Leap
Seven Keys to Unlock and Lead Innovation Strategy
Credera 2017 Chief Marketing Officer survey
Enterprise Social Networking: Strategy and Implementation with SharePoint 2013
SharePoint Information Architecture
Office 365 Migration Planning
UX Kick Start: Start Your Project Off On the Right Foot
Agile Comes To You
SharePoint Commerce Services
Microsoft Cloud Services - Introducing the Value of BPOS
Microsoft X
JQuery and WCF for a Better User Experience
Open Admin - GWT
Aspnet mvc vs_web_forms_final
Winning With APIs

Recently uploaded (20)

PPTX
TLE Review Electricity (Electricity).pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Hybrid model detection and classification of lung cancer
PPTX
Tartificialntelligence_presentation.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Web App vs Mobile App What Should You Build First.pdf
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Getting Started with Data Integration: FME Form 101
TLE Review Electricity (Electricity).pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
O2C Customer Invoices to Receipt V15A.pptx
DP Operators-handbook-extract for the Mautical Institute
Zenith AI: Advanced Artificial Intelligence
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
observCloud-Native Containerability and monitoring.pptx
Hybrid model detection and classification of lung cancer
Tartificialntelligence_presentation.pptx
Hindi spoken digit analysis for native and non-native speakers
Enhancing emotion recognition model for a student engagement use case through...
Web App vs Mobile App What Should You Build First.pdf
Module 1.ppt Iot fundamentals and Architecture
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Group 1 Presentation -Planning and Decision Making .pptx
Chapter 5: Probability Theory and Statistics
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Getting Started with Data Integration: FME Form 101

From delegates, to lamdas and expression trees your guide to elegant code in c#.net 4.0