ExtensionMethod.NET is a database of C# 3.0 and Visual Basic 2008 extension methods. It contains many user-rated extension methods that will expand your code library immediately.

Extension methods add functionality to existing classes and allow you to expand the .NET framework. This way your favorite functions integrate seamlessly into the framework. For more information about extension methods visit the C# 3.0 and Visual Basic 2008 MSDN Library pages.

We invite you to submit your favorite extension methods and download and use others.

TOP 3 Extension Methods

OrderBy(string sortExpression)  Submitted by C.F.Meijers on 2008/4/25 Orders a list based on a sortexpression. Useful in object databinding scenarios where the objectdatasource generates a dynamic sortexpression (example: "Name desc") that specifies the property of the object sort on.Language C# Type System.Collections.Generic.IEnumerable<T> Downloads 50
IsValidUrl  Submitted by unkown on 2007/10/17 Returns true when a string is a valid url Language C# Type System.String Downloads 38
Encrypt & Decrypt  Submitted by Mark de Rover on 2008/1/02 Encrypt and decrypt a string using the RSACryptoServiceProvider.Language C# Type System.String Downloads 32

Recently added

HasValueAndEquals  Submitted by MatteoSp on 2008/10/01 Substitutes this: int? index = GetIndex(); if (index.HasValue && index.Value == 10) ...Language C# Type System.Nullable<T> Downloads 3
TryDispose  Submitted by MatteoSp on 2008/10/01 Dispose an object if it implement IDisposable. Especially useful when working with interfaces and object factories, and IDisposable may or may not found on concrete class.Language C# Type System.Object Downloads 0
ContainsNoSpaces  Submitted by R. van Duren on 2008/9/04 Checks if a string contains no spacesLanguage C# Type System.String Downloads 2