I'm using 2005 beta 2 for some live projects at work at the moment and I'm loving it. I especially love generic lists. It's great to have dynamic, type safe lists. Now if I want a list of Customer objects I can do the following...
List<Customer> CustomerList = new List<Customer>();
Customer c = new Customer(435, "John Brown Ltd.", "admin@johnbrown.com");
CustomerList.Add(c);
foreach(Customer c in CustomerList)
{
string emailAddressString = c.EmailAddress;
//... Do stuff with email address
}
Previously I would've had to have cast each of the objects as I popped them from the ArrayList or have written a special accessor to return a Customer[].
Finding Customers in the list is a lot easier now with anonymous methods. To find Customer by Id I just have to write...
public Customer GetCustomerById(string CustIdString)
{
return Customers.Find(delegate(Customer c)
{
return c.Id == CustIdString;
});
}