Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Linq (from the inside)

2,381 views

Published on

Knowing how to use Linq is useful if you're doing any coding using .NET 3.5 or newer. But have you ever thought about what is going on "under the hood"?

Join us as we dive into the guts of Linq and implement Linq extension methods such as Where, Select, Any, All and Aggregate. Not only is it interesting to see what's going on, it'll help you to build better code using Linq.

Published in: Technology
  • Be the first to comment

Linq (from the inside)

  1. 1. Linq (from the inside)Reinventing the Linq to Objects wheel Mike Clement mike@softwareontheside.com @mdclement
  2. 2. LINQ to Amazon LINQ to Metaweb(freebase)LINQ to Active Directory LINQ to MySQL, Oracle andLINQ to Bindable Sources (SyncLINQ) PostgreSql (DbLinq)LINQ to C# project LINQ to NCoverLINQ to Continuous Data (CLinq) LINQ to Opf3LINQ to CRM LINQ to Parallel (PLINQ)LINQ To Geo - Language Integrated Query for LINQ to RDF FilesGeospatial Data LINQ to SharepointLINQ to Excel LINQ to SimpleDBLINQ to Expressions (MetaLinq) LINQ to StreamsLINQ Extender (Toolkit for building LINQ LINQ to TwitterProviders) LINQ to WebQueriesLINQ to Flickr LINQ to WMILINQ to Google http://tomasp.net/blog/linq-LINQ to Indexes (LINQ and i40) expand.aspxLINQ to IQueryable (Matt Warren on http://tomasp.net/blog/linq-expand-Providers) update.aspxLINQ to JSON Linq To WIQLLINQ to LDAP LINQ to XtraGridLINQ to NHibernateLINQ to JavaScript Source:LINQ to LLBLGen Pro http://blogs.msdn.com/b/charlie/archive/20LINQ to Lucene 06/10/05/links-to-linq.aspx
  3. 3. If I have seenfurther it is bystanding on theshoulders of giants. -Sir Issac Newton
  4. 4. http://stackoverflow.com/users/22656/jon-skeet
  5. 5. • 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.
  6. 6. • 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
  7. 7. from cust in customerswhere cust.City == "London"select cust;customers.Where(cust => cust.City == "London");
  8. 8. C# Language Features• Query Expressions• Implicitly Typed Variables• Object and Collection Initializers• Anonymous Types• Extension Methods• Lambda Expressions• Auto-implemented Properties• Iterator blocks• Generics
  9. 9. Anatomy of an extension methodpublic static voidMethod(this IInterfacemyInterface, int i)
  10. 10. Learning by Doing… we’ll figure it out as we go.IMPLEMENT LINQ TO OBJECTS
  11. 11. C# Language Features• Query Expressions• Implicitly Typed Variables• Object and Collection Initializers• Anonymous Types• Extension Methods• Lambda Expressions• Auto-implemented Properties• Iterator blocks• Generics
  12. 12. 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
  13. 13. 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!
  14. 14. 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

×