Browse by Tags

All Tags » Generics » .NET (RSS)
In this prior post , I demonstrated how to build a generic list of items. The example built a list of individual customers. This post demonstrates how to build a generic list of items where one of those items is another generic list. In this example,...
4 comment(s)
Filed under: , , , ,
One of the new features in VB 10.0 is collection initializers. Collection initializers allow you to initialize an array or list in a single line of code. (C# has had collection initializers since C# 3.0. The examples here show both C# and VB for completeness...
6 comment(s)
Filed under: , , , , ,
In this prior post , I detailed how to build lists of things using a generic List<T>. Once you have a list, you may need to find items in the list. There are several ways to accomplish this, but using lambda expressions is the most concise. [To...
My presentation at our local Code Camp was fun. I covered a lot of material and had a GREAT audience. Several people have asked for the slide information in my blog. So this is the start of several posts on lambda expressions. In addition, I wrote an...
A data type is said to be nullable if it can be assigned a value or a null reference. Reference types , such as strings and class types, are nullable; they can be set to a null reference, and the result is a null value. Value types , such as integers...
3 comment(s)
Filed under: , , , ,
Defining a list of integers in your code involves lots of tedious typing. In VB, you can’t do this: 'Dim numberList As new List(Of Integer) = {1, 2, 3, 4, 5, 6, 7, 8, 9} So you have to either add numbers to the list manually, or create an array, which...
with no comments
Filed under: , , , , ,
Often times applications require lists of things: lists of customers, lists of experiments, lists of accounts and so on. The generic lists provided in .NET 2.0 made working with these lists easy. And the list initializers in C# and the object initializers...
10 comment(s)
Filed under: , , , , ,