Skip to content

Methods_T_CodeJam_Collections_CollectionExtensions

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

CollectionExtensions Methods

Methods

 

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