Vote UpVote

Using Extension methods on Lists to make it fluent

Coding Power Unleashed – Since C# 3.0 you can write extension methods on any class that you want, even if you don’t have the source code of the class. In other words you can extend a class with your own methods. Extension methods can only be declared in static classes as static methods. Extensions on List<T> classes can be very handy and make your code more readable and fluent. Suppose you have this mixed Animal list with Dogs and Cats from this blogpost. List<Animal> animalList = new List<Animal>(); animalList.Add(new Dog("Dog1", ConsoleColor.Red)); animalList.Add(new ...
Favorite? Off-Topic? Roland Beenhakker @ 2010-05-19 16:00


Visits: 545
Votes: 4
Favorites: 0
Off-Topic: 1

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Mohammed Nasman
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)