SlideShare una empresa de Scribd logo
1 de 24
Linq (from the inside)

Reinventing the Linq to Objects wheel
           Mike Clement
   mike@softwareontheside.com
            @mdclement
LINQ to Amazon                              LINQ to Metaweb(freebase)
LINQ to Active Directory                    LINQ to MySQL, Oracle and
LINQ to Bindable Sources (SyncLINQ)         PostgreSql (DbLinq)
LINQ to C# project                          LINQ to NCover
LINQ to Continuous Data (CLinq)             LINQ to Opf3
LINQ to CRM                                 LINQ to Parallel (PLINQ)
LINQ To Geo - Language Integrated Query for LINQ to RDF Files
Geospatial Data                             LINQ to Sharepoint
LINQ to Excel                               LINQ to SimpleDB
LINQ to Expressions (MetaLinq)              LINQ to Streams
LINQ Extender (Toolkit for building LINQ    LINQ to Twitter
Providers)                                  LINQ to WebQueries
LINQ to Flickr                              LINQ to WMI
LINQ to Google                                   http://tomasp.net/blog/linq-
LINQ to Indexes (LINQ and i40)                   expand.aspx
LINQ to IQueryable (Matt Warren on               http://tomasp.net/blog/linq-expand-
Providers)                                       update.aspx
LINQ to JSON                                Linq To WIQL
LINQ to LDAP                                LINQ to XtraGrid
LINQ to NHibernate
LINQ to JavaScript                          Source:
LINQ to LLBLGen Pro                         http://blogs.msdn.com/b/charlie/archive/20
LINQ to Lucene                              06/10/05/links-to-linq.aspx
If I have seen
further it is by
standing on the
shoulders of giants.
           -Sir Issac Newton
http://stackoverflow.com/users/22656/jon-skeet
• Jon Skeet is immutable. If something’s going to change, it’s going
  to have to be the rest of the universe.
• Jon Skeet is the only top 100 SO user who is human. The others
  are bots that he coded to pass the time between questions.
• Jon Skeet does not use revision control software. None of his
  code has ever needed revision.
• When Jon Skeet’s code fails to compile, the compiler apologizes.
• Jon Skeet is the traveling salesman. Only he knows the shortest
  route.
• The Dining Philosophers wait while Jon Skeet eats.
• When Jon Skeet points to null, null quakes in fear.
• Jon Skeet does not use exceptions when programming. He has
  not been able to identify any of his code that is not exceptional.
• Jon Skeet has already written a book about
  C# 5.0.
• It’s currently sealed up.
• In three years, Anders Hejlsberg is going to
  open the book to see if the language design
  team got it right
from cust in customers
where cust.City == "London"
select cust;

customers.Where(
cust => cust.City == "London");
C# Language Features
•   Query Expressions
•   Implicitly Typed Variables
•   Object and Collection Initializers
•   Anonymous Types
•   Extension Methods
•   Lambda Expressions
•   Auto-implemented Properties

• Iterator blocks
• Generics
Anatomy of an extension method

public static void
Method(this IInterface
myInterface, int i)
Learning by Doing… we’ll figure it out as we go.

IMPLEMENT LINQ TO OBJECTS
C# Language Features
•   Query Expressions
•   Implicitly Typed Variables
•   Object and Collection Initializers
•   Anonymous Types
•   Extension Methods
•   Lambda Expressions
•   Auto-implemented Properties

• Iterator blocks
• Generics
Resources
•   Classification by Manner of Execution
•   C# Features
•   List of Linq Providers (and other links)
•   EduLinq code blog posts (from Jon Skeet)
•   MoreLinq (from Jon Skeet)
•   My Starter Project
    – https://github.com/mdclement/Linq--from-the-
      inside--Presentation-Base
Action Items!
• Read Jon Skeet’s EduLinq series.
• Download my “starter” and play!
• If you aren’t already, use Linq in your everyday
  coding.
• Look for other Linq operators to implement.
• Attend the Utah Software Craftsmanship
  Group!
Me
•   @mdclement
•   mike@softwareontheside.com
•   http://blog.softwareontheside.com
•   Utah Software Craftsmanship Group
    – https://groups.google.com/forum/#!forum/ut-
      software-craftsmanship
    – @utahsc
    – First Wednesday, Neumont, Room 300

Más contenido relacionado

Destacado

Summer Beach Trip Packing List
Summer Beach Trip Packing ListSummer Beach Trip Packing List
Summer Beach Trip Packing List
Luke Keeler
 

Destacado (17)

Object Relational Mapping with LINQ To SQL
Object Relational Mapping with LINQ To SQLObject Relational Mapping with LINQ To SQL
Object Relational Mapping with LINQ To SQL
 
LINQ 概要 + 結構便利な LINQ to XML
LINQ 概要 + 結構便利な LINQ to XMLLINQ 概要 + 結構便利な LINQ to XML
LINQ 概要 + 結構便利な LINQ to XML
 
Think in linq
Think in linqThink in linq
Think in linq
 
Poster research
Poster researchPoster research
Poster research
 
1 201010243711613
1 2010102437116131 201010243711613
1 201010243711613
 
Buku dinamika opt
Buku dinamika optBuku dinamika opt
Buku dinamika opt
 
Amma paranja 8 kathakal
Amma paranja 8 kathakalAmma paranja 8 kathakal
Amma paranja 8 kathakal
 
LINQ in C#
LINQ in C#LINQ in C#
LINQ in C#
 
Summer Beach Trip Packing List
Summer Beach Trip Packing ListSummer Beach Trip Packing List
Summer Beach Trip Packing List
 
Bong montesa mapping gph milf fa
Bong montesa mapping gph milf faBong montesa mapping gph milf fa
Bong montesa mapping gph milf fa
 
Lucie McLean — Come Together: Building Product Culture in Non-Digital Organis...
Lucie McLean — Come Together: Building Product Culture in Non-Digital Organis...Lucie McLean — Come Together: Building Product Culture in Non-Digital Organis...
Lucie McLean — Come Together: Building Product Culture in Non-Digital Organis...
 
Philippines | Rebels, tribal leaders to ‘marry’ ideals
Philippines | Rebels, tribal leaders to ‘marry’ idealsPhilippines | Rebels, tribal leaders to ‘marry’ ideals
Philippines | Rebels, tribal leaders to ‘marry’ ideals
 
THE OWL AND THE PUSSY CAT- ppt
THE OWL AND THE PUSSY CAT- pptTHE OWL AND THE PUSSY CAT- ppt
THE OWL AND THE PUSSY CAT- ppt
 
Bouguereaus Nudes
Bouguereaus NudesBouguereaus Nudes
Bouguereaus Nudes
 
El gran gimnasta santacruzano
El gran gimnasta santacruzanoEl gran gimnasta santacruzano
El gran gimnasta santacruzano
 
Hot Amala Paul
Hot Amala PaulHot Amala Paul
Hot Amala Paul
 
Step Daughter Ch. 05
Step Daughter Ch. 05
Step Daughter Ch. 05
Step Daughter Ch. 05
 

Similar a Linq (from the inside)

How We Fixed Our MongoDB Problems
How We Fixed Our MongoDB Problems How We Fixed Our MongoDB Problems
How We Fixed Our MongoDB Problems
MongoDB
 
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
Lucas Jellema
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
elliando dias
 
"Python web development combines the simplicity of the language with powerful...
"Python web development combines the simplicity of the language with powerful..."Python web development combines the simplicity of the language with powerful...
"Python web development combines the simplicity of the language with powerful...
softwaretrainer2elys
 
Clean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code CampClean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code Camp
Theo Jungeblut
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
jeffz
 
LibX2.0-Code4Lib-2009AsPresented
LibX2.0-Code4Lib-2009AsPresentedLibX2.0-Code4Lib-2009AsPresented
LibX2.0-Code4Lib-2009AsPresented
tutorialsruby
 
LibX2.0-Code4Lib-2009AsPresented
LibX2.0-Code4Lib-2009AsPresentedLibX2.0-Code4Lib-2009AsPresented
LibX2.0-Code4Lib-2009AsPresented
tutorialsruby
 

Similar a Linq (from the inside) (20)

cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
 
How We Fixed Our MongoDB Problems
How We Fixed Our MongoDB Problems How We Fixed Our MongoDB Problems
How We Fixed Our MongoDB Problems
 
PyData Texas 2015 Keynote
PyData Texas 2015 KeynotePyData Texas 2015 Keynote
PyData Texas 2015 Keynote
 
Reaktive Programmierung mit den Reactive Extensions (Rx)
Reaktive Programmierung mit den Reactive Extensions (Rx)Reaktive Programmierung mit den Reactive Extensions (Rx)
Reaktive Programmierung mit den Reactive Extensions (Rx)
 
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
How and Why you can and should Participate in Open Source Projects (AMIS, Sof...
 
DDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan PaulovichDDD Tactical Design with Clean Architecture - Ivan Paulovich
DDD Tactical Design with Clean Architecture - Ivan Paulovich
 
Lisp in the Cloud
Lisp in the CloudLisp in the Cloud
Lisp in the Cloud
 
UCLA HACKU'11
UCLA HACKU'11UCLA HACKU'11
UCLA HACKU'11
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
 
MCN 2014: Make One, Contribute Many: Sharing Image Metadata via LIDO
MCN 2014: Make One, Contribute Many: Sharing Image Metadata via LIDOMCN 2014: Make One, Contribute Many: Sharing Image Metadata via LIDO
MCN 2014: Make One, Contribute Many: Sharing Image Metadata via LIDO
 
Linq
LinqLinq
Linq
 
"Python web development combines the simplicity of the language with powerful...
"Python web development combines the simplicity of the language with powerful..."Python web development combines the simplicity of the language with powerful...
"Python web development combines the simplicity of the language with powerful...
 
Building GUI App with Electron and Lisp
Building GUI App with Electron and LispBuilding GUI App with Electron and Lisp
Building GUI App with Electron and Lisp
 
Sp biz conf - using office graph api
Sp biz conf - using office graph apiSp biz conf - using office graph api
Sp biz conf - using office graph api
 
Putting together a web app
Putting together a web appPutting together a web app
Putting together a web app
 
Modern ClojureScript
Modern ClojureScriptModern ClojureScript
Modern ClojureScript
 
Clean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code CampClean Code Part III - Craftsmanship at SoCal Code Camp
Clean Code Part III - Craftsmanship at SoCal Code Camp
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
 
LibX2.0-Code4Lib-2009AsPresented
LibX2.0-Code4Lib-2009AsPresentedLibX2.0-Code4Lib-2009AsPresented
LibX2.0-Code4Lib-2009AsPresented
 
LibX2.0-Code4Lib-2009AsPresented
LibX2.0-Code4Lib-2009AsPresentedLibX2.0-Code4Lib-2009AsPresented
LibX2.0-Code4Lib-2009AsPresented
 

Más de Mike Clement

Code Katas Spring 2012
Code Katas Spring 2012Code Katas Spring 2012
Code Katas Spring 2012
Mike Clement
 
FizzBuzz Guided Kata
FizzBuzz Guided KataFizzBuzz Guided Kata
FizzBuzz Guided Kata
Mike Clement
 
Bowling Game Kata in C# Adapted
Bowling Game Kata in C# AdaptedBowling Game Kata in C# Adapted
Bowling Game Kata in C# Adapted
Mike Clement
 
Software Craftsmanship
Software CraftsmanshipSoftware Craftsmanship
Software Craftsmanship
Mike Clement
 
Using Rhino Mocks for Effective Unit Testing
Using Rhino Mocks for Effective Unit TestingUsing Rhino Mocks for Effective Unit Testing
Using Rhino Mocks for Effective Unit Testing
Mike Clement
 

Más de Mike Clement (20)

Collaboration Principles from Mob Programming
Collaboration Principles from Mob ProgrammingCollaboration Principles from Mob Programming
Collaboration Principles from Mob Programming
 
Focus on Flow: Lean Principles in Action
Focus on Flow: Lean Principles in ActionFocus on Flow: Lean Principles in Action
Focus on Flow: Lean Principles in Action
 
Taming scary production code that nobody wants to touch
Taming scary production code that nobody wants to touchTaming scary production code that nobody wants to touch
Taming scary production code that nobody wants to touch
 
Develop your sense of code smell
Develop your sense of code smellDevelop your sense of code smell
Develop your sense of code smell
 
Maps over Backlogs: User Story Mapping to Share the Big Picture
Maps over Backlogs: User Story Mapping to Share the Big PictureMaps over Backlogs: User Story Mapping to Share the Big Picture
Maps over Backlogs: User Story Mapping to Share the Big Picture
 
Escaping the Pitfalls of Software Product Development
Escaping the Pitfalls of Software Product DevelopmentEscaping the Pitfalls of Software Product Development
Escaping the Pitfalls of Software Product Development
 
Put the Tests Before the Code
Put the Tests Before the CodePut the Tests Before the Code
Put the Tests Before the Code
 
Mob Programming for Continuous Learning
Mob Programming for Continuous LearningMob Programming for Continuous Learning
Mob Programming for Continuous Learning
 
Play to Learn: Agile Games with Cards and Dice
Play to Learn: Agile Games with Cards and DicePlay to Learn: Agile Games with Cards and Dice
Play to Learn: Agile Games with Cards and Dice
 
The Quest for Continuous Delivery at Pluralsight
The Quest for Continuous Delivery at PluralsightThe Quest for Continuous Delivery at Pluralsight
The Quest for Continuous Delivery at Pluralsight
 
Software Craftsmanship and Agile Code Games
Software Craftsmanship and Agile Code GamesSoftware Craftsmanship and Agile Code Games
Software Craftsmanship and Agile Code Games
 
Thinking in F#
Thinking in F#Thinking in F#
Thinking in F#
 
Transformation Priority Premise: TDD Test Order Matters
Transformation Priority Premise: TDD Test Order MattersTransformation Priority Premise: TDD Test Order Matters
Transformation Priority Premise: TDD Test Order Matters
 
Power of Patterns: Refactoring to (or away from) Patterns
Power of Patterns: Refactoring to (or away from) PatternsPower of Patterns: Refactoring to (or away from) Patterns
Power of Patterns: Refactoring to (or away from) Patterns
 
Code Katas Spring 2012
Code Katas Spring 2012Code Katas Spring 2012
Code Katas Spring 2012
 
FizzBuzz Guided Kata
FizzBuzz Guided KataFizzBuzz Guided Kata
FizzBuzz Guided Kata
 
Bowling Game Kata in C# Adapted
Bowling Game Kata in C# AdaptedBowling Game Kata in C# Adapted
Bowling Game Kata in C# Adapted
 
Code Katas: Practicing Your Craft
Code Katas: Practicing Your CraftCode Katas: Practicing Your Craft
Code Katas: Practicing Your Craft
 
Software Craftsmanship
Software CraftsmanshipSoftware Craftsmanship
Software Craftsmanship
 
Using Rhino Mocks for Effective Unit Testing
Using Rhino Mocks for Effective Unit TestingUsing Rhino Mocks for Effective Unit Testing
Using Rhino Mocks for Effective Unit Testing
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Linq (from the inside)

  • 1. Linq (from the inside) Reinventing the Linq to Objects wheel Mike Clement mike@softwareontheside.com @mdclement
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. LINQ to Amazon LINQ to Metaweb(freebase) LINQ to Active Directory LINQ to MySQL, Oracle and LINQ to Bindable Sources (SyncLINQ) PostgreSql (DbLinq) LINQ to C# project LINQ to NCover LINQ to Continuous Data (CLinq) LINQ to Opf3 LINQ to CRM LINQ to Parallel (PLINQ) LINQ To Geo - Language Integrated Query for LINQ to RDF Files Geospatial Data LINQ to Sharepoint LINQ to Excel LINQ to SimpleDB LINQ to Expressions (MetaLinq) LINQ to Streams LINQ Extender (Toolkit for building LINQ LINQ to Twitter Providers) LINQ to WebQueries LINQ to Flickr LINQ to WMI LINQ to Google http://tomasp.net/blog/linq- LINQ to Indexes (LINQ and i40) expand.aspx LINQ to IQueryable (Matt Warren on http://tomasp.net/blog/linq-expand- Providers) update.aspx LINQ to JSON Linq To WIQL LINQ to LDAP LINQ to XtraGrid LINQ to NHibernate LINQ to JavaScript Source: LINQ to LLBLGen Pro http://blogs.msdn.com/b/charlie/archive/20 LINQ to Lucene 06/10/05/links-to-linq.aspx
  • 8. If I have seen further it is by standing on the shoulders of giants. -Sir Issac Newton
  • 10. • Jon Skeet is immutable. If something’s going to change, it’s going to have to be the rest of the universe. • Jon Skeet is the only top 100 SO user who is human. The others are bots that he coded to pass the time between questions. • Jon Skeet does not use revision control software. None of his code has ever needed revision. • When Jon Skeet’s code fails to compile, the compiler apologizes. • Jon Skeet is the traveling salesman. Only he knows the shortest route. • The Dining Philosophers wait while Jon Skeet eats. • When Jon Skeet points to null, null quakes in fear. • Jon Skeet does not use exceptions when programming. He has not been able to identify any of his code that is not exceptional.
  • 11. • Jon Skeet has already written a book about C# 5.0. • It’s currently sealed up. • In three years, Anders Hejlsberg is going to open the book to see if the language design team got it right
  • 12. from cust in customers where cust.City == "London" select cust; customers.Where( cust => cust.City == "London");
  • 13. C# Language Features • Query Expressions • Implicitly Typed Variables • Object and Collection Initializers • Anonymous Types • Extension Methods • Lambda Expressions • Auto-implemented Properties • Iterator blocks • Generics
  • 14. Anatomy of an extension method public static void Method(this IInterface myInterface, int i)
  • 15.
  • 16.
  • 17.
  • 18. Learning by Doing… we’ll figure it out as we go. IMPLEMENT LINQ TO OBJECTS
  • 19.
  • 20.
  • 21. C# Language Features • Query Expressions • Implicitly Typed Variables • Object and Collection Initializers • Anonymous Types • Extension Methods • Lambda Expressions • Auto-implemented Properties • Iterator blocks • Generics
  • 22. Resources • Classification by Manner of Execution • C# Features • List of Linq Providers (and other links) • EduLinq code blog posts (from Jon Skeet) • MoreLinq (from Jon Skeet) • My Starter Project – https://github.com/mdclement/Linq--from-the- inside--Presentation-Base
  • 23. Action Items! • Read Jon Skeet’s EduLinq series. • Download my “starter” and play! • If you aren’t already, use Linq in your everyday coding. • Look for other Linq operators to implement. • Attend the Utah Software Craftsmanship Group!
  • 24. Me • @mdclement • mike@softwareontheside.com • http://blog.softwareontheside.com • Utah Software Craftsmanship Group – https://groups.google.com/forum/#!forum/ut- software-craftsmanship – @utahsc – First Wednesday, Neumont, Room 300

Notas del editor

  1. Not Link cosplay! Not that there’s anything wrong with that…
  2. The “other” Microsoft “link”
  3. Language-Integrated QueryQuery is first class citizen in languageQueries are consistent across data sourcesOne query language to rule them all
  4. Don’t want to get too far in without recognizing the true brains behind this presentation.
  5. Monster on StackOverflowWrote “C# In Depth” (excellent read… I need to pick up the second edition)Wrote the Edulinq blog posts (and project that I’m based on today)
  6. http://msdn.microsoft.com/en-us/library/bb882642.aspxSo back to Linq…Query Expression Syntax vs. Extension MethodsNote that given the providers, “customers” could be XML, a database, a web service…But then they split it into two different syntaxes? Syntacies?“real” linq (integrated query) only supports a subset of what the full extension methods support.
  7. These language features are used to implement Linq either explicitly or “from the inside”Query syntax inlinevar keywordCustomer cust = new Customer { Name = "Mike", Phone = "555-1212" };An anonymous type is constructed by the compiler and the type name is only available to the compiler. Anonymous types provide a convenient way to group a set of properties temporarily in a query result without having to define a separate named type. An extension method is a static method that can be associated with a type, so that it can be called as if it were an instance method on the type. This feature enables you to, in effect, "add" new methods to existing types without actually modifying them.A lambda expression is an inline function that uses the => operator to separate input parameters from the function body and can be converted at compile time to a delegate or an expression tree.the compiler will create a private, anonymous backing field that is not accessible except through the property getter and setter.
  8. Linq operators are defined as extension methods on IEnumerable<T>So it’s important that we understand the anatomy of extension methods.Extension methods are defined as static methods but are called by using instance method syntax. Their first parameter specifies which type the method operates on, and the parameter is preceded by the this modifier. Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive.
  9. Going to pull back the curtain
  10. Unfortunately it may feel like this for a little bit…House in Poland
  11. Going to pull back the curtain
  12. These language features are used to implement Linq either explicitly or “from the inside”Query syntax inlinevar keywordCustomer cust = new Customer { Name = "Mike", Phone = "555-1212" };An anonymous type is constructed by the compiler and the type name is only available to the compiler. Anonymous types provide a convenient way to group a set of properties temporarily in a query result without having to define a separate named type. An extension method is a static method that can be associated with a type, so that it can be called as if it were an instance method on the type. This feature enables you to, in effect, "add" new methods to existing types without actually modifying them.A lambda expression is an inline function that uses the => operator to separate input parameters from the function body and can be converted at compile time to a delegate or an expression tree.the compiler will create a private, anonymous backing field that is not accessible except through the property getter and setter.