Generated by DocFX

Class EnumerableExtensions

Class EnumerableExtensions.

Inheritance
System.Object
EnumerableExtensions
Namespace: ISynergy.Framework.Core.Extensions
Assembly: ISynergy.Framework.Core.dll
Syntax
public static class EnumerableExtensions : object

Methods

View Source

CountPages<TSource>(IEnumerable<TSource>, Int32)

Counts the pages of an count result, according to a certain pagesize.

Declaration
public static int CountPages<TSource>(this IEnumerable<TSource> source, int pageSize)
Parameters
Type Name Description
IEnumerable<TSource> source

The source.

System.Int32 pageSize

Has to be greater than 0.

Returns
Type Description
System.Int32

System.Int32.

Type Parameters
Name Description
TSource

The type of the t source.

View Source

GetFlags(Enum)

Gets the flags.

Declaration
public static IEnumerable<Enum> GetFlags(this Enum value)
Parameters
Type Name Description
Enum value

The value.

Returns
Type Description
IEnumerable<Enum>

IEnumerable<Enum>.

View Source

GetIndividualFlags(Enum)

Gets the individual flags.

Declaration
public static IEnumerable<Enum> GetIndividualFlags(this Enum value)
Parameters
Type Name Description
Enum value

The value.

Returns
Type Description
IEnumerable<Enum>

IEnumerable<Enum>.

View Source

GetTypeOfT<T>(IEnumerable<T>)

Gets the type of t.

Declaration
public static Type GetTypeOfT<T>(this IEnumerable<T> _)
Parameters
Type Name Description
IEnumerable<T> _

The .

Returns
Type Description
Type

Type.

Type Parameters
Name Description
T
View Source

HasAny(Enum, Enum)

Determines whether the two specified values have any flags in common.

Declaration
public static bool HasAny(this Enum value, Enum desiredFlags)
Parameters
Type Name Description
Enum value

Value to test

Enum desiredFlags

Flags we wish to find

Returns
Type Description
System.Boolean

Whether the two specified values have any flags in common.

View Source

ToDataTable(IEnumerable, Type, String)

Converts to datatable.

Declaration
public static DataTable ToDataTable(this IEnumerable collection, Type type, string tableName)
Parameters
Type Name Description
IEnumerable collection

The collection.

Type type

The type.

System.String tableName

Name of the table.

Returns
Type Description
DataTable

DataTable.

View Source

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

Converts to datatable.

Declaration
public static DataTable ToDataTable<T>(this IEnumerable<T> collection, string tableName)
Parameters
Type Name Description
IEnumerable<T> collection

The collection.

System.String tableName

Name of the table.

Returns
Type Description
DataTable

DataTable.

Type Parameters
Name Description
T
View Source

ToPage<TSource>(IEnumerable<TSource>, Int32, Int32)

Applies paging to a . Take note that this should be applied after any Where-clauses, to make sure you're not missing any results.

Declaration
public static IEnumerable<TSource> ToPage<TSource>(this IEnumerable<TSource> source, int page, int pageSize = null)
Parameters
Type Name Description
IEnumerable<TSource> source

The source.

System.Int32 page

Has to be non-negative.

System.Int32 pageSize

Has to be greater than 0.

Returns
Type Description
IEnumerable<TSource>

IEnumerable<TSource>.

Type Parameters
Name Description
TSource

The type of the t source.

Exceptions
Type Condition
ArgumentBelowZeroException

pageSize