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

Over 100 Extension Methods

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.

We need your feedback about this website. We've noticed some user comments regarding redundant or untested extension methods. We're working on a voting system that allows to dispose extension methods. If you have more feedback, email it to us

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 918
Pivot  Submitted by Fons Sonnemans on 2009-1-21 Groups the elements of a sequence according to a specified firstKey selector function and rotates the unique values from the secondKey selector function into multiple values in the output, and performs aggregations. Language C# Type System.Collections.Generic.IEnumerable<T> Downloads 694
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 689

Recently added

ToOracleSqlDate  Submitted by csonic on 2012-1-19 Converts a Timestamp to a String which can be used in a Oracle SQL QueryLanguage C# Type System.DateTime Downloads 0
DeleteChars  Submitted by Érico Luis Barrientos Leite on 2012-1-14 Remove from the given string, all characters provided in a params array of chars.Language C# Type System.String Downloads 4
GetData<T>  Submitted by Lee Hull on 2012-1-06 Get a saved value from the app domain and convert it back to its original typeLanguage C# Type System.AppDomain Downloads 0
Tail  Submitted by smolesen on 2011-12-29 Set the stream position to the place where for example 10 lines will be returned when read to end.Language C# Type System.IO.Stream Downloads 0
IsNothingOrEmpty  Submitted by Luis Costa on 2011-12-14 Return if a datatable is nothing or if is empty.Language VB Type System.Data.DataTable Downloads 0
FirstOrNothing  Submitted by Fons Sonnemans on 2011-12-14 Returns the first element of a sequence, or a nullable value which has no value if no element is found.Language VB Type System.Collections.Generic.IEnumerable<T> Downloads 0
ToEnumerable()  Submitted by Richard Dingwall on 2011-12-09 Convert an IEnumerator<T> to IEnumerable<T>.Language C# Type System.IEnumerator<T> Downloads 0
GetOrThrow(string connectionStringName)  Submitted by Richard Dingwall on 2011-12-09 By default, ConfigurationManager.ConnectionStrings returns null if the requested connection string doesn't exist. Use this extension method if you want something a bit more snappy - an exception.Language C# Type System.Configuration.ConnectionStringSettingsCollection Downloads 1
WrapEachWithTag  Submitted by Graham Peel on 2011-12-06 Creates a string that is each the elements' ToString() values wrapped in the 'tag' that is passed as a param. Good for converting an IEnum<T> into a block of HTML/XML.Language C# Type System.Collections.Generic.IEnumerable<T> Downloads 1
NullDateToString  Submitted by Graham Peel on 2011-12-06 Prints out a nullable datetime's value (if its not null) in the string format specified as a parameter. A final parameter is specified for what to print if the nullable datetime was, in fact, null.Language C# Type System.DateTime Downloads 0