EasyAF_IEnumerableExtensions

Syntax

public static class EasyAF_IEnumerableExtensions

Inheritance

Methods

AcceptChanges<T>

public static void AcceptChanges<T>(this IEnumerable<T> enumerable, bool goDeep = false) where T : DbObservableObject
Loops through the entries in a given and accepts all current changes for each entry.

Parameters

ChangedCount<T>

public static int ChangedCount<T>(this IEnumerable<T> enumerable, bool checkGraph = false) where T : DbObservableObject
Returns a representing the number of objects in the enumerable that have changes.

Parameters

Returns

int

ContainsId<T, TId>

public static bool ContainsId<T, TId>(this IEnumerable<T> list, TId idValue) where T : class, IIdentifiable<TId> where TId : struct
Returns a if a list of s from the given contains the specified value.

Parameters

  • list IEnumerable<T>: The to check for the given ID value.
  • idValue TId: The value to check for.

Returns

bool

ContentsAreChanged<T, TForeign, TId>

public static bool ContentsAreChanged<T, TForeign, TId>(this IEnumerable<T> enumerable, IEnumerable<TForeign> foreignList, Func<T, TId> foreignIdFunc, bool checkGraph = false) where T : DbObservableObject, IIdentifiable<TId> where TForeign : DbObservableObject, IIdentifiable<TId> where TId : struct
Returns a if any in the has changes.

Parameters

  • enumerable IEnumerable<T>:
  • foreignList IEnumerable<TForeign>: The list of related objects that we want to filter the enumerable down to.
  • foreignIdFunc Func<T, TId>: The property from the enumerable that points to the for the objects in foreignList.
  • checkGraph bool:

Returns

bool

ContentsAreChanged<T>

public static bool ContentsAreChanged<T>(this IEnumerable<T> enumerable, bool checkGraph = false) where T : DbObservableObject
Returns a if any in the has changes.

Parameters

Returns

bool

ContentsAreChanged<T>

public static bool ContentsAreChanged<T>(this IEnumerable<T> enumerable, Func<T, bool> predicate, bool checkGraph = false) where T : DbObservableObject
Returns a if any in the has changes.

Parameters

Returns

bool

FilterForChanges<T, TForeign, TId>

public static IEnumerable<T> FilterForChanges<T, TForeign, TId>(this IEnumerable<T> enumerable, IEnumerable<TForeign> foreignList, Func<T, TId> foreignIdFunc) where T : DbObservableObject, IIdentifiable<TId> where TForeign : DbObservableObject, IIdentifiable<TId> where TId : struct
For a given , filter down the result to the changed items in enumerable whose foreign keys appear in the foreignList.

Parameters

  • enumerable IEnumerable<T>: The list we want to check for changes in.
  • foreignList IEnumerable<TForeign>: The list of related objects that we want to filter the enumerable down to.
  • foreignIdFunc Func<T, TId>: The property from the enumerable that points to the for the objects in foreignList.

Returns

IEnumerable<T>

None<T>

public static bool None<T>(this IEnumerable<T> source, Func<T, bool> predicate)
Returns a specifying whether or not the has any items in it.

Parameters

Returns

bool

None<T>

public static bool None<T>(this IEnumerable<T> source)
Returns a specifying whether or not the has any items in it.

Parameters

Returns

bool

RejectChanges<T>

public static void RejectChanges<T>(this IEnumerable<T> enumerable, bool goDeep = false) where T : DbObservableObject
Loops through the entries in a given and clears all current changes for each entry.

Parameters

ToTrackedList<T>

public static List<T> ToTrackedList<T>(this IEnumerable<T> enumerable, bool deepTracking = false) where T : DbObservableObject
Returns a where the have turned on.

Parameters

  • enumerable IEnumerable<T>: The list of objects to turn change tracking on for.
  • deepTracking bool:

Returns

List<T>