4
votes
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

Statistics

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

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
jamiei
Mohammed Nasman
Sorcerer
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

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