Tuesday, September 30, 2008

My Favourite Anonymous Delegate

Just to test out the editing capabilities here, I'll display a bit of code I use often.
Let's say I have a business entity class to keep some data.


public class MyBusinessEntity
{
public string MyProperty = string.Empty;
}

I keep these business entities in a List


List listToSearch = new List();
// fill the list with actual data

I need to select all business entities that satisfy to a certain criteria.

List listIFound = 
listToSearch.FindAll(delegate(MyBusinessEntity entity)
{
return (entity.MyProperty == "myTestString");
});

listIFound will now contain all instances of MyBusinessEntity from listToSearch where MyProperty equals "myTestString".

by . Also posted on my website

Monday, September 29, 2008

Good Deed For The Day

Everyone seems to have a blog these days. If you don’t have a blog, you should at least read heaps of other people’s blogs. Otherwise you might as well live in a stone age. So, what would be the fastest way to become much more advanced, much more Web 2.0 compatible in the shortest period of time today? Create your own blog. Here we go. Tick.
by . Also posted on my website