Skip to main content

EnumerableUtils

Assembly: ServiceStack.Blazor.dll
View Source
Declaration
public static class EnumerableUtils

Methods

IsEmpty(ICollection)

View Source
Declaration
public static bool IsEmpty(this ICollection collection)
Returns

System.Boolean

Parameters
TypeName
System.Collections.ICollectioncollection

IsEmpty<T>(T[])

View Source
Declaration
public static bool IsEmpty<T>(this T[] collection)
Returns

System.Boolean

Parameters
TypeName
<T>[]collection
Type Parameters
  • T

IsEmpty<T>(Nullable<List<T>>)

View Source
Declaration
public static bool IsEmpty<T>(this List<T>? collection)
Returns

System.Boolean

Parameters
TypeName
System.Nullable<List<<T>>>collection
Type Parameters
  • T

EmptyIfNull<T>(T[])

View Source
Declaration
public static T[] EmptyIfNull<T>(this T[] collection)
Returns

<T>[]

Parameters
TypeName
<T>[]collection
Type Parameters
  • T

EmptyIfNull<T>(Nullable<List<T>>)

View Source
Declaration
public static List<T> EmptyIfNull<T>(this List<T>? collection)
Returns

List<<T>>

Parameters
TypeName
System.Nullable<List<<T>>>collection
Type Parameters
  • T

AsList(Object)

View Source
Declaration
public static List<object>? AsList(this object items)
Returns

System.Nullable<List<System.Object>>

Parameters
TypeName
System.Objectitems

AsStringList(Object)

View Source
Declaration
public static List<string>? AsStringList(this object items)
Returns

System.Nullable<List<System.String>>

Parameters
TypeName
System.Objectitems

AsList(IEnumerable)

View Source
Declaration
public static List<object>? AsList(this IEnumerable items)
Returns

System.Nullable<List<System.Object>>

Parameters
TypeName
System.Collections.IEnumerableitems

AsList<T>(Nullable<IEnumerable<T>>)

View Source
Declaration
public static List<T> AsList<T>(this IEnumerable<T>? items)
Returns

List<<T>>

Parameters
TypeName
System.Nullable<System.Collections.IEnumerable<<T>>>items
Type Parameters
  • T

Map<To, From>(Nullable<IEnumerable<From>>, Func<From, To>)

View Source
Declaration
public static List<To> Map<To, From>(this IEnumerable<From>? items, Func<From, To> converter)
Returns

List<<To>>

Parameters
TypeName
System.Nullable<System.Collections.IEnumerable<<From>>>items
Func<<From>,<To>>converter
Type Parameters
  • To
  • From

Map<To>(IEnumerable, Func<Object, To>)

View Source
Declaration
public static List<To> Map<To>(this IEnumerable items, Func<object, To> converter)
Returns

List<<To>>

Parameters
TypeName
System.Collections.IEnumerableitems
Func<System.Object,<To>>converter
Type Parameters
  • To

FirstElementType(IEnumerable, String)

View Source
Declaration
public static Type FirstElementType(this IEnumerable collection, string key)
Returns

Type

Parameters
TypeName
System.Collections.IEnumerablecollection
System.Stringkey

GetIgnoreCase<T>(IDictionary<String, T>, String)

View Source
Declaration
public static T GetIgnoreCase<T>(this IDictionary<string, T> map, string name)
Returns

<T>

Parameters
TypeName
System.Collections.IDictionary<System.String,<T>>map
System.Stringname
Type Parameters
  • T

FirstOrDefault(IEnumerable)

View Source
Declaration
public static object FirstOrDefault(IEnumerable e)
Returns

System.Object

Parameters
TypeName
System.Collections.IEnumerablee

Count(IEnumerable)

View Source
Declaration
public static int Count(IEnumerable e)
Returns

System.Int32

Parameters
TypeName
System.Collections.IEnumerablee