Skip to content

Methods_T_CodeJam_Collections_CollectionExtensions

Andrew Koryavchenko edited this page Jun 17, 2018 · 4 revisions

CollectionExtensions Methods

Methods

 

Name Description
Public method Static member AddRange(T)(ICollection(T), IEnumerable(T)) Adds the elements to the end of the ICollection(T).
Public method Static member AddRange(T)(ICollection(T), IList(T)) Adds the elements to the end of the ICollection(T).
Public method Static member AddRange(T)(ICollection(T), T[]) Adds the elements to the end of the ICollection(T).
Public method Static member DefaultIfEmpty(T)(List(T), T) Returns a new collection with default value if the collection is empty.
Public method Static member DefaultIfEmpty(T)(T[], T) Returns a new array with default value if the array is empty.
Public method Static member DefaultIfEmpty(TKey, TValue)(Dictionary(TKey, TValue), TKey, TValue) Returns a new dictionary with default value if the dictionary is empty.
Public method Static member DefaultIfEmpty(TKey, TValue)(Dictionary(TKey, TValue), TKey, TValue, IEqualityComparer(TKey)) Returns a new dictionary with default value if the dictionary is empty.
Public method Static member EmptyIfNull(T)(IEnumerable(T)) Returns an empty instance of the collection for null values.
Public method Static member EmptyIfNull(T)(List(T)) Returns an empty instance of the collection for null values.
Public method Static member EmptyIfNull(T)(T[]) Returns an empty instance of the array for null values.
Public method Static member EmptyIfNull(TKey, TValue)(Dictionary(TKey, TValue)) Returns an empty instance of the dictionary for null values.
Public method Static member EmptyIfNull(TKey, TValue)(Dictionary(TKey, TValue), IEqualityComparer(TKey)) Returns an empty instance of the dictionary for null values.
Public method Static member IsNullOrEmpty(T)(ICollection(T)) Indicates whether the specified collection is null or empty.
Public method Static member IsNullOrEmpty(T)(T[]) Indicates whether the specified array is null or empty.
Public method Static member NotNullNorEmpty(T)(ICollection(T)) Indicates whether the specified collection is not null nor empty.
Public method Static member NotNullNorEmpty(T)(T[]) Indicates whether the specified array is is not null nor empty.
Public method Static member NullIfEmpty(T)(List(T)) Returns null if the collection is empty.
Public method Static member NullIfEmpty(T)(T[]) Returns null if the collection is array.
Public method Static member NullIfEmpty(TKey, TValue)(Dictionary(TKey, TValue)) Returns null if the dictionary is empty.
  Back to Top

See Also

Reference

CollectionExtensions Class
CodeJam.Collections Namespace

Clone this wiki locally