CollectionExtensions
Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class CollectionExtensions
Methods
CreateAndPopulate<T>(Type, T[])
View Source
Declaration
public static ICollection<T> CreateAndPopulate<T>(Type ofCollectionType, T[] withItems)
Returns
System.Collections.Generic.ICollection<<T>>
Parameters
Type | Name |
---|---|
System.Type | ofCollectionType |
<T>[] | withItems |
Type Parameters
T
ToArray<T>(ICollection<T>)
View Source
Declaration
public static T[] ToArray<T>(this ICollection<T> collection)
Returns
<T>[]
Parameters
Type | Name |
---|---|
System.Collections.Generic.ICollection<<T>> | collection |
Type Parameters
T
Convert<T>(Object, Type)
View Source
Declaration
public static object Convert<T>(object objCollection, Type toCollectionType)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | objCollection |
System.Type | toCollectionType |
Type Parameters
T
OrEmpty<T>(IEnumerable<T>)
Return T[0] when enumerable is null, safe to use in enumerations like foreach
View Source
Declaration
public static IEnumerable<T> OrEmpty<T>(this IEnumerable<T> enumerable)
Returns
System.Collections.Generic.IEnumerable<<T>>
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<<T>> | enumerable |
Type Parameters
T
OrEmpty(IEnumerable)
View Source
Declaration
public static IEnumerable OrEmpty(this IEnumerable enumerable)
Returns
System.Collections.IEnumerable
Parameters
Type | Name |
---|---|
System.Collections.IEnumerable | enumerable |