Extension Methods from Joel Mueller
-
NameValueCollection.ToUrlString
Converts a NameValueCollection (such as Request.Form) into a url-formatted string of name/value pairs.
-
IDataRecord.Field<'a>
This mimics the DataRow.Field<T> extension method found in System.Data.DatasetExtensions.dll, except it supports the F# Option type, and works on an IDataReader/IDataRecord/DataRow. Pair this with the IDataReader.AsSeq extension for extra utility.
-
String.ToEnum<'a>
Shortcut for the .NET 4 Enum.TryParse(). Defaults to ignoring case, returns an F# Option to indicate success/failure. Unlike a C# extension method, this is able to enforce that the generic type is an enum at compile time.
-
IDictionary<>.TryGet
Like IDictionary<>.TryGetValue, but returns the result as an Option, which is more convenient to work with from F#.
-
XPathNodeIterator.AsEnumerable
Exposes an XPathNodeIterator as an IEnumerable<XPathNavigator> for easy looping.
-
SqlCommand.AsyncMethods
A set of extension methods to allow asynchronous SqlClient operations to integrate with F# async workflows.
-
Color.ToHtmlColor
Converts a Color object to a string suitable for including in HTML or CSS.
-
Random.GetValues
Generates an infinite sequence of random numbers that fall within a given range.
-
IDataReader.AsSeq
Exposes a reader's current result set as seq<IDataRecord>. Reader is closed when sequence is fully enumerated. Bonus method: turns an IDataReader with multiple result sets into a seq<seq<IDataRecord>>.
-
Nullable.AsOption
Converts a System.Nullable to an F# Option.
-
IDataReader.ToDataSet
Converts an IDataReader into a DataSet, without requiring a DataAdapter.