Browse by Tags

All Tags » Lambda » C# (RSS)
The Enumerable class is new in .NET 3.5 and is part of the System.Linq namespace. It provides a set of static methods that allow you to query any object that implements IEnumerable, basically meaning any object that supports a for/each. This post focuses...
3 comment(s)
Filed under: , , , ,
The Enumerable class is new in .NET 3.5 and is part of the System.Linq namespace. It provides a set of static methods that allow you to query any object that implements IEnumerable, basically meaning any object that supports a for/each. This post focuses...
5 comment(s)
Filed under: , , , ,
I have an XML string as follows: <States>   <State name="Wisconsin">     <Regions>       <Region name="Milwaukee">         <Area...
4 comment(s)
Filed under: , , , , , ,
The last several posts have provided examples of using anonymous types. This post backs up a little and provides an introduction if you are not already familiar with anonymous types. If you are familiar with anonymous types and are looking for  more...
7 comment(s)
Filed under: , , , , ,
This may be more of a homework assignment for a programming class than something you would do in your applications, but it is a good example of using anonymous types, which are new in .Net 3.5 in both VB and C#. [To begin with an overview of anonymous...
8 comment(s)
Filed under: , , , , ,
Some of the collections in the Microsoft Office object models implement IEnumerable. The IEnumerable interface provides the ability to perform a for/each against the collection. With .NET 3.5, a Cast extension method of IEnumerable allows you to work...
Last night, my husband (who is also a .NET developer) asked me about sorting a DataTable by user-defined columns. (Yes, we are a pretty exciting couple!) Most developers that work with DataTables know how to sort the DataTable using a DataView.Sort. If...
Visual Studio comes with DateTimePicker and MonthCalendar controls that provide a standard looking calendar for the user to pick a date. But there are times when these controls don’t provide the features you need. For example, say you want to ask the...
Looping through a list to append strings is often more challenging than it should be. For example… In C#: string emailAddresses=string.Empty; foreach (Customer c in custList) {     emailAddresses += c.EmailAddress + ";"; } In...
6 comment(s)
Filed under: , , , ,
One of my favorite features in .NET 3.5 is lambda expressions. [To begin with an overview of lambda expressions, start here .] This example demonstrates how to use lambda expressions: To compare items in two lists and find which items in one list are...
3 comment(s)
Filed under: , , ,
More Posts « Previous page