LINQ ToLookup vs ToDictionary

Some people are not sure of the difference between ToLookup vs ToDictionary LINQ methods. To break it down real simple: One is a look up (ToLookup) One is a dictionary (ToDictionary) Duh – that’s what you’re probably thinking. The real difference is understanding what each of these data structures do. Lookups A lookup is a [...]

  • Share/Bookmark

Tags: , , ,

Read Users' Comments (0)

Implementing LINQ on the .NET Micro Framework

The .NET Micro Framework, a variant of .NET radically scaled down for embedded systems, does not include the System.Linq namespace and does not provide any LINQ functionality. Because its implementation is based on generics, LINQ requires version 2.0 of the CLR. The Micro Framework on the other hand is restricted to the CLI, a standardized [...]

  • Share/Bookmark

Tags: , , , ,

Read Users' Comments (0)

How to Use .Except with EqualityComparer

Today we’re going to cover an advanced scenario where we need to compare lists of a class we created. We’ll start with an implementation of EqualityComparer<T> which consists of overriding two methods: Equals and GetHashCode. What was a little tricky about this implementation is this subtle, but critical, comment in the code sample on MSDN [...]

  • Share/Bookmark

Tags: , , , , , ,

Read Users' Comments (1)

Guidelines and Best Practices in Optimizing LINQ

Language Integrated Query (LINQ) is a query execution pipeline for use in the managed environment of .NET Framework. In essence, LINQ is Microsoft’s object relational mapper between your business objects and the underlying data sources and provides a simplified framework for accessing relational data in an object-oriented fashion. Although LINQ is great in the sense [...]

  • Share/Bookmark

Tags: , ,

Read Users' Comments (1)

Why You Need to Know LINQ to XML

In .NET 3.5, the primary device for general processing of XML is LINQ To XML. This provides a lightweight, LINQ-friendly DOM along with a set of query operators. In SiIlverlight, this is your only choice – XmlDocument and related classes are not supported. Even without its LINQ support, the LINQ To XML DOM is valuable [...]

  • Share/Bookmark

Tags: , , , ,

Read Users' Comments (0)

Generic Delegates and Lambda Expressions

Generic delegates and lambda expressions underpin LINQ. If you’ve been struggling to get your arms around these new concepts, this post should help demystify matters for you. Of course, there are a a host of other new .NET language features that enable LINQ as well. These include extension methods, type inference, anonymous types, object initializers, [...]

  • Share/Bookmark

Tags: , , , , ,

Read Users' Comments (0)

Practical Understanding of Lambda Expressions in LINQ

Lambda expressions are a powerful tool to writing quick, concise code. They can be used in numerous situations, most notably in conjuction with LINQ statements. A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types. All lambda expressions use the lambda [...]

  • Share/Bookmark

Tags: , , , ,

Read Users' Comments (0)