HDI Video: Generate from Usage in Visual Studio 2010 with Karen Liu

Karen Liu, the Lead Program Manager for the Visual C# and Visual Basic IDEs, has created a new video on Generate from Usage (GFU), a feature found in Visual Studio 2010, Beta 2. This post recaps what is included in the video, including the sections that show how GFU can be used to enhance test…

1

Silverlight Revisited

I’ve written about Silverlight in previous posts published on this blog. Recently, however, I’ve found my thoughts coming back to this subject. This is hardly unusual: many people are interested in Silverlight. The reason for the attraction to this technology is not hard to discover. Silverlight allows us to build visually appealing web applications with…

6

Query Data with Parallel LINQ

This post shows a simple way to write code that takes advantage of multiple processors. You will see that LINQ queries can allow you to side step the difficult tasks normally involved in writing multi-threaded code. To get started, all you need is a little basic knowledge of how to write simple LINQ queries. The…

23

LINQ Farm: Covariance and Contravariance in C# 4.0

This post covers the upcoming C# 4.0 support for covariance and contravariance when working with delegates and interfaces. Eric Lippert’s series of posts on this subject are definitely the definitive reference at this time. I’m writing this overview of the subject simply as an appendix to his explanation, and as quick reference for folks who…

37

LINQ Farm: Preserving Formatting with LINQ to XML

In a previous post, you saw how to work with line numbers when using LINQ to XML to read a file. This post continues in the same vein, but this time the focus is on how to: Read in an XML file with an arbitrary format, and then write it back out to disk in…

2

LINQ Farm: LINQ to XML and Line Numbers

There are times when it is useful to know the line number of a node in an XML file. This information can be a helpful to users, particularly if you want to report an error. It can also be convenient to search for a node by line number, but that can, of course, be a…

8

LINQ Farm: More on the LINQ Aggregate Operators

The LINQ aggregate operators allow you to perform simple math operations over the elements in a sequence. This post is designed to walk you through those operators, and give you an overview of how to use them. Table 1 shows a list of the 7 aggregate operators. Note: All the samples shown in this post…

7

LINQ Farm: More on Set Operators

This is a second post on the LINQ Set operators, the first being published while LINQ was still in beta. As mentioned in the previous post, there are four LINQ set operators: Union, Intersect, Distinct and Except. Like the other 49 LINQ operators, these methods are designed to allow you to query data which supports…

5

LINQ Farm: Lambdas

Lambdas are a simple technology with an intimidating name. They sound like they are going to be difficult to understand, but in practice prove to be relatively trivial. LINQ has an almost inordinate need for its users to declare a large number of small, simple delegates. The architects of C# decided that forcing the users…

34

LINQ Farm: Extension Methods and Scoping

There are a few scoping rules that you must keep in mind when using extensions methods. Problems with scoping and extensions methods are rare, but when you encounter them they are quite vexing. An instance method will always be called before an extension method. The runtime looks first for an instance method, if it finds…

11