Skip to main content

ListExtensions

Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class ListExtensions

Methods

Join<T>(IEnumerable<T>)

View Source
Declaration
public static string Join<T>(this IEnumerable<T> values)
Returns

System.String

Parameters
TypeName
System.Collections.Generic.IEnumerable<<T>>values
Type Parameters
  • T

Join<T>(IEnumerable<T>, String)

View Source
Declaration
public static string Join<T>(this IEnumerable<T> values, string seperator)
Returns

System.String

Parameters
TypeName
System.Collections.Generic.IEnumerable<<T>>values
System.Stringseperator
Type Parameters
  • T

IsNullOrEmpty<T>(List<T>)

View Source
Declaration
public static bool IsNullOrEmpty<T>(this List<T> list)
Returns

System.Boolean

Parameters
TypeName
System.Collections.Generic.List<<T>>list
Type Parameters
  • T

SafeWhere<TFrom>(List<TFrom>, Func<TFrom, Boolean>)

View Source
Declaration
public static IEnumerable<TFrom> SafeWhere<TFrom>(this List<TFrom> list, Func<TFrom, bool> predicate)
Returns

System.Collections.Generic.IEnumerable<<TFrom>>

Parameters
TypeName
System.Collections.Generic.List<<TFrom>>list
System.Func<<TFrom>,System.Boolean>predicate
Type Parameters
  • TFrom

NullableCount<T>(List<T>)

View Source
Declaration
public static int NullableCount<T>(this List<T> list)
Returns

System.Int32

Parameters
TypeName
System.Collections.Generic.List<<T>>list
Type Parameters
  • T

AddIfNotExists<T>(ICollection<T>, T)

View Source
Declaration
public static void AddIfNotExists<T>(this ICollection<T> list, T item)
Parameters
TypeName
System.Collections.Generic.ICollection<<T>>list
<T>item
Type Parameters
  • T

AddDistinctRange<T>(ICollection<T>, IEnumerable<T>)

View Source
Declaration
public static void AddDistinctRange<T>(this ICollection<T> list, IEnumerable<T> items)
Parameters
TypeName
System.Collections.Generic.ICollection<<T>>list
System.Collections.Generic.IEnumerable<<T>>items
Type Parameters
  • T

NewArray<T>(T[], T, T)

View Source
Declaration
public static T[] NewArray<T>(this T[] array, T with = null, T without = null)
where T : class
Returns

<T>[]

Parameters
TypeName
<T>[]array
<T>with
<T>without
Type Parameters
  • T

InList<T>(T)

View Source
Declaration
public static List<T> InList<T>(this T value)
Returns

System.Collections.Generic.List<<T>>

Parameters
TypeName
<T>value
Type Parameters
  • T

InArray<T>(T)

View Source
Declaration
public static T[] InArray<T>(this T value)
Returns

<T>[]

Parameters
TypeName
<T>value
Type Parameters
  • T

Add<T>(List<Type>)

View Source
Declaration
public static List<Type> Add<T>(this List<Type> types)
Returns

System.Collections.Generic.List<System.Type>

Parameters
TypeName
System.Collections.Generic.List<System.Type>types
Type Parameters
  • T

OrderBy<TEntity>(IQueryable<TEntity>, String)

View Source
Declaration
public static IQueryable<TEntity> OrderBy<TEntity>(this IQueryable<TEntity> source, string sqlOrderByList)
Returns

System.Linq.IQueryable<<TEntity>>

Parameters
TypeName
System.Linq.IQueryable<<TEntity>>source
System.StringsqlOrderByList
Type Parameters
  • TEntity