Features

Here is a list of the features by category.

As of Release on 2009_03_06

Validation

  • Generic
    • IsNull(this object) : bool - Returns true if the object is null. Works with all reference types.
    • IsNotNull(this object) : bool - Returns true if the object is not null. Works with all reference types.
    • AssertParameterNotNull(this object, string, string) : void - Throws an ArgumentNullException with the specified message and parameter name if the object is null. Works with all reference types.
    • AssertEquals<ExceptionType>(this object, object, message) : void where ExceptionType : System.Exception - Throws an exception of the generic type specified if the values are not equal. The message of the exception is the string parameter. Works with all objects.
  • Strings
    • IsEmpty(this string) : bool - Returns true if the string is empty.
    • IsNotEmpty(this string) : bool - Returns true if the string is not empty.
    • IsNullOrEmpty(this string) : bool - Returns true if the string is either null or empty.
    • AssertParameterNotEmpty(this string, string, string) : void - Throws an ArgumentException with the specified message and parameter name if the string is empty.
  • Collections - IsEmpty
    • IsEmpty(this ICollection) : bool - Returns true if the instance of ICollection is empty.
    • IsEmpty<T>(this ICollection<T>) : bool - Returns true if the instance of ICollection<T> is empty.
    • IsEmpty(this IList) : bool - Returns true if the instance of IList is empty.
    • IsEmpty<T>(this IList<T>) : bool - Returns true if the instance of IList<T> is empty.
    • IsEmpty(this IDictionary) : bool - Returns true if the instance of IDictionary is empty.
    • IsEmpty<K, T>(this IDictionary<K, T>) : bool - Returns true if the instance of IDictionary<K, T> is empty.
    • IsEmpty(this DataTable) : bool - Returns true if the DataTable does not contain any DataRows.
    • IsEmpty(this Array) : bool - Returns true if the Array has a length of 0.
  • Collections - IsNotEmpty
    • IsNotEmpty(this ICollection) : bool - Returns true if the instance of ICollection is not empty.
    • IsNotEmpty<T>(this ICollection<T>) : bool - Returns true if the instance of ICollection<T> is not empty.
    • IsNotEmpty(this IList) : bool - Returns true if the instance of IList is not empty.
    • IsNotEmpty<T>(this IList<T>) : bool - Returns true if the instance of IList<T> is not empty.
    • IsNotEmpty(this IDictionary) : bool - Returns true if the instance of IDictionary is not empty.
    • IsNotEmpty<K, T>(this IDictionary<K, T>) : bool - Returns true if the instance of IDictionary<K, T> is not empty.
    • IsNotEmpty(this DataTable) : bool - Returns true if the DataTable does contain any DataRows.
    • IsNotEmpty(this Array) : bool - Returns true if the Array has a length greater than 0.

Collections

  • First Element of Collection
    • FirstItem<T>(this List<T>) : T - Returns the reference to the generic object T at the first position of the List<T>.
    • FirstItem(this Array) : object - Returns the reference to the object where the index of the array is 0.
    • FirstRow<T>(this DataTable) : T Where T : DataRow - Returns the first DataRow of the DataTable.

Reflection

  • Create Instances of Objects
    • CreateInstance<T>(this Type, object[]) : T - Returns an initialized instance of the generic object T using the parameters specified. If the type of parameters do not match the expected parameters of any constructor then an ArgumentException is thrown. If the parameters array is null then an ArgumentNullException is thrown.
    • CreateInstance<T>(this Type) : T Where T : new() - Returns an initialized instance of the generic object T using the default constructor.

For Next Release

Collections

  • Create DataRow from Object
    • AsDataRow<T>(this object, DataTable) : T Where T : DataRow - Creates an instance of the specified DataRow type and populates the DataRow from the properties of the object specified.
    • AsDataRow<T>(this object, DataTable, Dictionary<string, DataColumn>) : T Where T : DataRow - Creates an instance of the specified DataRow type and populates the DataRow by matching the property names of the object ot the Columns in the Dictionary.
  • Create DataTable from Collection
    • AsDataTable(this ICollection) : DataTable - Returns a base DataTable. Each object in the collection is examined and a DataColumn is created for each public property of the object. Each object is converted to a DataRow and added to the DataTable.
    • AsDataTable(this ICollection, IDictionary<string, DataColumn>) : DataTable - Returns a base DataTable. The DataColumns of the Dictionary are assigned to the DataTable.. Each object is converted to a DataRow with the Dictionary as a field map and added to the DataTable.
    • AsDataTable<T>(this ICollection<T>) : DataTable - Returns a base DataTable. Each public property of the generic type T is used to create a DataColumn in the DataTable. Each object is converted to a DataRow and added to the DataTable.
    • AsDataTable<T>(this ICollection<T>, IDictionary<string, DataColumn>) : DataTable - Returns a base DataTable. The DataColumns provided in the Dictionary are assigned to the DataTable. Each object is converted to a DataRow with the Dictionary as a field map and added to the DataTable.
    • AsDataTable(this IList) : DataTable - Returns a base DataTable. Each object in the collection is examined and a DataColumn is created for each public property of the object. Each object is converted to a DataRow and added to the DataTable.
    • AsDataTable(this IList, IDictionary<string, DataColumn>) : DataTable - Returns a base DataTable. The DataColumns of the Dictionary are assigned to the DataTable.. Each object is converted to a DataRow with the Dictionary as a field map and added to the DataTable.
    • AsDataTable<T>(this IList<T>) : DataTable - Returns a base DataTable. Each public property of the generic type T is used to create a DataColumn in the DataTable. Each object is converted to a DataRow and added to the DataTable.
    • AsDataTable<T>(this IList<T>, IDictionary<string, DataColumn>) : DataTable - Returns a base DataTable. The DataColumns provided in the Dictionary are assigned to the DataTable. Each object is converted to a DataRow with the Dictionary as a field map and added to the DataTable.
    • AsDataTable(this IDictionary, string) : DataTable - Returns a base DataTable. Each object in the collection is examined and a DataColumn is created for each public property of the object. The specified string contains the property of each object that is used as the primary key whose value must match the key in the Dictionary. Each object is converted to a DataRow and added to the DataTable. Throws an Exception if not all objects contain the specified key property.
    • AsDataTable<K, T>(this IList<K, T>, string) : DataTable - Returns a base DataTable. Each public property of the generic type T is used to create a DataColumn in the DataTable. The string provided must be the name of a property of generic type T that will be used as the primary key of the DataTable. The values of the primary key property must match the value of the key in the Dictionary. Each object is converted to a DataRow and added to the DataTable. Throws an Exception if any of the object's key property does not match the key in the Dictionary.
    • AsDataTable(this Array) : DataTable - Returns a base DataTable. Each object in the array is examined and a DataColumn is created for each public property of the object. Each object is converted to a DataRow and added to the DataTable.
    • AsDataTable(this Array, IDictionary<string, DataColumn>) : DataTable - Returns a base DataTable. The DataColumns of the Dictionary are assigned to the DataTable.. Each object is converted to a DataRow with the Dictionary as a field map and added to the DataTable.

Last edited Mar 8, 2009 at 12:16 AM by plbyrd, version 3

Comments

vkelman Apr 12, 2009 at 7:38 AM 
Hello! Here's a nice generic Max/MaxItem extension method written by Steve Michelotti http://geekswithblogs.net/michelotti/archive/2009/02/06/custom-c-3.0-linq-max-extension-method.aspx