EntityFrameworkQueryableExtensions EntityFrameworkQueryableExtensions Class

Entity Framework LINQ related extension methods.

Syntax

Declaration

public static class EntityFrameworkQueryableExtensionsPublic Module EntityFrameworkQueryableExtensions

Inheritance Hierarchy

  • System.Object
    System.Object
  • EntityFrameworkQueryableExtensions
    EntityFrameworkQueryableExtensions

Inherited Members

ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Methods summary

Asynchronously determines whether all the elements of a sequence satisfy a condition.

Asynchronously determines whether any element of a sequence satisfies a condition.

Asynchronously determines whether a sequence contains any elements.

Returns a new query where the change tracker will not track any of the entities that are returned. If the entity instances are modified, this will not be detected by the change tracker and SaveChanges() will not persist those changes to the database.

Disabling change tracking is useful for read-only scenarios because it avoids the overhead of setting up change tracking for each entity instance. You should not disable change tracking if you want to manipulate entity instances and persist those changes to the database using SaveChanges().

Identity resolution will still be performed to ensure that all occurrences of an entity with a given key in the result set are represented by the same entity instance.

The default tracking behavior for queries can be controlled by QueryTrackingBehavior.

Returns a new query where the change tracker will keep track of changes for all entities that are returned. Any modification to the entity instances will be detected and persisted to the database during SaveChanges().

The default tracking behavior for queries can be controlled by QueryTrackingBehavior.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously determines whether a sequence contains a specified element by using the default equality comparer.

Asynchronously returns the number of elements in a sequence that satisfy a condition.

Asynchronously returns the number of elements in a sequence.

Asynchronously returns the first element of a sequence that satisfies a specified condition.

Asynchronously returns the first element of a sequence.

Asynchronously returns the first element of a sequence that satisfies a specified condition or a default value if no such element is found.

Asynchronously returns the first element of a sequence, or a default value if the sequence contains no elements.

Asynchronously enumerates the query results and performs the specified action on each element.

Specifies related entities to include in the query results. The navigation property to be included is specified starting with the type of entity being queried (TEntity). Further navigation properties to be included can be appended, separated by the '.' character.

Specifies related entities to include in the query results. The navigation property to be included is specified starting with the type of entity being queried (TEntity). If you wish to include additional types based on the navigation properties of the type being included, then chain a call to

ThenInclude<TEntity, TPreviousProperty, TProperty>(IIncludableQueryable<TEntity, IEnumerable<TPreviousProperty>>, Expression<Func<TPreviousProperty, TProperty>>) after this call.

Asynchronously returns the last element of a sequence that satisfies a specified condition.

Asynchronously returns the last element of a sequence.

Asynchronously returns the last element of a sequence that satisfies a specified condition or a default value if no such element is found.

Asynchronously returns the last element of a sequence, or a default value if the sequence contains no elements.

Enumerates the query. When using Entity Framework, this causes the results of the query to be loaded into the associated context. This is equivalent to calling ToList and then throwing away the list (without the overhead of actually creating the list).

Asynchronously enumerates the query. When using Entity Framework, this causes the results of the query to be loaded into the associated context. This is equivalent to calling ToList and then throwing away the list (without the overhead of actually creating the list).

Asynchronously returns an System.Int64 that represents the number of elements in a sequence that satisfy a condition.

Asynchronously returns an System.Int64 that represents the total number of elements in a sequence.

Asynchronously returns the maximum value of a sequence.

Asynchronously invokes a projection function on each element of a sequence and returns the maximum resulting value.

Asynchronously returns the minimum value of a sequence.

Asynchronously invokes a projection function on each element of a sequence and returns the minimum resulting value.

Asynchronously returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

Asynchronously returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.

Asynchronously returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

Asynchronously returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of a sequence of values.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

Specifies additional related data to be further included based on a related type that was just included.

Specifies additional related data to be further included based on a related type that was just included.

Asynchronously creates an array from an System.Linq.IQueryable<T> by enumerating it asynchronously.

Creates a System.Collections.Generic.Dictionary<TKey, TValue> from an System.Linq.IQueryable<T> by enumerating it asynchronously according to a specified key selector function and a comparer.

Creates a System.Collections.Generic.Dictionary<TKey, TValue> from an System.Linq.IQueryable<T> by enumerating it asynchronously according to a specified key selector function.

Creates a System.Collections.Generic.Dictionary<TKey, TValue> from an System.Linq.IQueryable<T> by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.

Creates a System.Collections.Generic.Dictionary<TKey, TValue> from an System.Linq.IQueryable<T> by enumerating it asynchronously according to a specified key selector and an element selector function.

Asynchronously creates a System.Collections.Generic.List<T> from an System.Linq.IQueryable<T> by enumerating it asynchronously.

Methods

  • AllAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    AllAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously determines whether all the elements of a sequence satisfy a condition.

    public static Task<bool> AllAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AllAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> whose elements to test for a condition.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test each element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Boolean>
      System.Threading.Tasks.Task<TResult>(Of System.Boolean)

      A task that represents the asynchronous operation. The task result contains true if every element of the source sequence passes the test in the specified predicate; otherwise, false.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AnyAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    AnyAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously determines whether any element of a sequence satisfies a condition.

    public static Task<bool> AnyAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AnyAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> whose elements to test for a condition.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test each element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Boolean>
      System.Threading.Tasks.Task<TResult>(Of System.Boolean)

      A task that represents the asynchronous operation. The task result contains true if any elements in the source sequence pass the test in the specified predicate; otherwise, false.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AnyAsync<TSource>(IQueryable<TSource>, CancellationToken)
    AnyAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously determines whether a sequence contains any elements.

    public static Task<bool> AnyAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AnyAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to check for being empty.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Boolean>
      System.Threading.Tasks.Task<TResult>(Of System.Boolean)

      A task that represents the asynchronous operation. The task result contains true if the source sequence contains any elements; otherwise, false.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AsNoTracking<TEntity>(IQueryable<TEntity>)
    AsNoTracking(Of TEntity)(IQueryable(Of TEntity))

    Returns a new query where the change tracker will not track any of the entities that are returned. If the entity instances are modified, this will not be detected by the change tracker and SaveChanges() will not persist those changes to the database.

    Disabling change tracking is useful for read-only scenarios because it avoids the overhead of setting up change tracking for each entity instance. You should not disable change tracking if you want to manipulate entity instances and persist those changes to the database using SaveChanges().

    Identity resolution will still be performed to ensure that all occurrences of an entity with a given key in the result set are represented by the same entity instance.

    The default tracking behavior for queries can be controlled by QueryTrackingBehavior.

    public static IQueryable<TEntity> AsNoTracking<TEntity>(this IQueryable<TEntity> source)where TEntity : class<ExtensionAttribute>
    Public Shared Function AsNoTracking(Of TEntity As Class)(source As IQueryable(Of TEntity)) As IQueryable(Of TEntity)

    Parameters

    • source
      System.Linq.IQueryable<T><TEntity>
      System.Linq.IQueryable<T>(Of TEntity)

      The source query.

    Returns

    • System.Linq.IQueryable<T><TEntity>
      System.Linq.IQueryable<T>(Of TEntity)

      A new query where the result set will not be tracked by the context.

  • AsTracking<TEntity>(IQueryable<TEntity>)
    AsTracking(Of TEntity)(IQueryable(Of TEntity))

    Returns a new query where the change tracker will keep track of changes for all entities that are returned. Any modification to the entity instances will be detected and persisted to the database during SaveChanges().

    The default tracking behavior for queries can be controlled by QueryTrackingBehavior.

    public static IQueryable<TEntity> AsTracking<TEntity>(this IQueryable<TEntity> source)where TEntity : class<ExtensionAttribute>
    Public Shared Function AsTracking(Of TEntity As Class)(source As IQueryable(Of TEntity)) As IQueryable(Of TEntity)

    Parameters

    • source
      System.Linq.IQueryable<T><TEntity>
      System.Linq.IQueryable<T>(Of TEntity)

      The source query.

    Returns

    • System.Linq.IQueryable<T><TEntity>
      System.Linq.IQueryable<T>(Of TEntity)

      A new query where the result set will not be tracked by the context.

  • AverageAsync(IQueryable<Decimal>, CancellationToken)
    AverageAsync(IQueryable(Of Decimal), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<decimal> AverageAsync(this IQueryable<decimal> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Decimal), cancellationToken As CancellationToken = Nothing) As Task(Of Decimal)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Decimal>
      System.Linq.IQueryable<T>(Of System.Decimal)

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Decimal>
      System.Threading.Tasks.Task<TResult>(Of System.Decimal)

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Double>, CancellationToken)
    AverageAsync(IQueryable(Of Double), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<double> AverageAsync(this IQueryable<double> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Double), cancellationToken As CancellationToken = Nothing) As Task(Of Double)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Double>
      System.Linq.IQueryable<T>(Of System.Double)

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Double>
      System.Threading.Tasks.Task<TResult>(Of System.Double)

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Int32>, CancellationToken)
    AverageAsync(IQueryable(Of Int32), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<double> AverageAsync(this IQueryable<int> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Integer), cancellationToken As CancellationToken = Nothing) As Task(Of Double)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Int32>
      System.Linq.IQueryable<T>(Of System.Int32)

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Double>
      System.Threading.Tasks.Task<TResult>(Of System.Double)

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Int64>, CancellationToken)
    AverageAsync(IQueryable(Of Int64), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<double> AverageAsync(this IQueryable<long> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Long), cancellationToken As CancellationToken = Nothing) As Task(Of Double)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Int64>
      System.Linq.IQueryable<T>(Of System.Int64)

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Double>
      System.Threading.Tasks.Task<TResult>(Of System.Double)

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Nullable<Decimal>>, CancellationToken)
    AverageAsync(IQueryable(Of Nullable(Of Decimal)), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<decimal ? > AverageAsync(this IQueryable<decimal ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Decimal?), cancellationToken As CancellationToken = Nothing) As Task(Of Decimal?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Decimal>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Decimal))

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Decimal>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Decimal))

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Nullable<Double>>, CancellationToken)
    AverageAsync(IQueryable(Of Nullable(Of Double)), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<double ? > AverageAsync(this IQueryable<double ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Double?), cancellationToken As CancellationToken = Nothing) As Task(Of Double?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Double>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Double))

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Double>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Double))

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Nullable<Int32>>, CancellationToken)
    AverageAsync(IQueryable(Of Nullable(Of Int32)), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<double ? > AverageAsync(this IQueryable<int ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Integer?), cancellationToken As CancellationToken = Nothing) As Task(Of Double?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Int32>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Int32))

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Double>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Double))

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Nullable<Int64>>, CancellationToken)
    AverageAsync(IQueryable(Of Nullable(Of Int64)), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<double ? > AverageAsync(this IQueryable<long ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Long?), cancellationToken As CancellationToken = Nothing) As Task(Of Double?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Int64>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Int64))

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Double>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Double))

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Nullable<Single>>, CancellationToken)
    AverageAsync(IQueryable(Of Nullable(Of Single)), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<float ? > AverageAsync(this IQueryable<float ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Single?), cancellationToken As CancellationToken = Nothing) As Task(Of Single?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Single>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Single))

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Single>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Single))

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync(IQueryable<Single>, CancellationToken)
    AverageAsync(IQueryable(Of Single), CancellationToken)

    Asynchronously computes the average of a sequence of values.

    public static Task<float> AverageAsync(this IQueryable<float> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(source As IQueryable(Of Single), cancellationToken As CancellationToken = Nothing) As Task(Of Single)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Single>
      System.Linq.IQueryable<T>(Of System.Single)

      A sequence of values to calculate the average of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Single>
      System.Threading.Tasks.Task<TResult>(Of System.Single)

      A task that represents the asynchronous operation. The task result contains the average of the sequence of values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Decimal>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Decimal)), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<decimal> AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Decimal)), cancellationToken As CancellationToken = Nothing) As Task(Of Decimal)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Decimal>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Decimal))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Decimal>
      System.Threading.Tasks.Task<TResult>(Of System.Decimal)

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Double>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Double)), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<double> AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Double)), cancellationToken As CancellationToken = Nothing) As Task(Of Double)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Double>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Double))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Double>
      System.Threading.Tasks.Task<TResult>(Of System.Double)

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Int32>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Int32)), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<double> AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Integer)), cancellationToken As CancellationToken = Nothing) As Task(Of Double)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Int32>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Int32))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Double>
      System.Threading.Tasks.Task<TResult>(Of System.Double)

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Int64>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Int64)), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<double> AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Long)), cancellationToken As CancellationToken = Nothing) As Task(Of Double)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Int64>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Int64))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Double>
      System.Threading.Tasks.Task<TResult>(Of System.Double)

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Decimal>>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Decimal))), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<decimal ? > AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Decimal?)), cancellationToken As CancellationToken = Nothing) As Task(Of Decimal?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Decimal>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Decimal)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Decimal>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Decimal))

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Double>>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Double))), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<double ? > AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Double?)), cancellationToken As CancellationToken = Nothing) As Task(Of Double?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Double>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Double)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Double>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Double))

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Int32>>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Int32))), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<double ? > AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Integer?)), cancellationToken As CancellationToken = Nothing) As Task(Of Double?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Int32>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Int32)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Double>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Double))

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Int64>>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Int64))), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<double ? > AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Long?)), cancellationToken As CancellationToken = Nothing) As Task(Of Double?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Int64>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Int64)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Double>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Double))

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Single>>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Single))), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<float ? > AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Single?)), cancellationToken As CancellationToken = Nothing) As Task(Of Single?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Single>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Single)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Single>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Single))

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Single>>, CancellationToken)
    AverageAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Single)), CancellationToken)

    Asynchronously computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<float> AverageAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function AverageAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Single)), cancellationToken As CancellationToken = Nothing) As Task(Of Single)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Single>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Single))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Single>
      System.Threading.Tasks.Task<TResult>(Of System.Single)

      A task that represents the asynchronous operation. The task result contains the average of the projected values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • ContainsAsync<TSource>(IQueryable<TSource>, TSource, CancellationToken)
    ContainsAsync(Of TSource)(IQueryable(Of TSource), TSource, CancellationToken)

    Asynchronously determines whether a sequence contains a specified element by using the default equality comparer.

    public static Task<bool> ContainsAsync<TSource>(this IQueryable<TSource> source, TSource item, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function ContainsAsync(Of TSource)(source As IQueryable(Of TSource), item As TSource, cancellationToken As CancellationToken = Nothing) As Task(Of Boolean)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the single element of.

    • item
      TSource
      TSource

      The object to locate in the sequence.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Boolean>
      System.Threading.Tasks.Task<TResult>(Of System.Boolean)

      A task that represents the asynchronous operation. The task result contains true if the input sequence contains the specified value; otherwise, false.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • CountAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    CountAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously returns the number of elements in a sequence that satisfy a condition.

    public static Task<int> CountAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function CountAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of Integer)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> that contains the elements to be counted.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test each element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Int32>
      System.Threading.Tasks.Task<TResult>(Of System.Int32)

      A task that represents the asynchronous operation. The task result contains the number of elements in the sequence that satisfy the condition in the predicate function.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • CountAsync<TSource>(IQueryable<TSource>, CancellationToken)
    CountAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the number of elements in a sequence.

    public static Task<int> CountAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function CountAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of Integer)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> that contains the elements to be counted.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Int32>
      System.Threading.Tasks.Task<TResult>(Of System.Int32)

      A task that represents the asynchronous operation. The task result contains the number of elements in the input sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • FirstAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    FirstAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously returns the first element of a sequence that satisfies a specified condition.

    public static Task<TSource> FirstAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function FirstAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the first element of.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test each element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the first element in source that passes the test in predicate.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • FirstAsync<TSource>(IQueryable<TSource>, CancellationToken)
    FirstAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the first element of a sequence.

    public static Task<TSource> FirstAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function FirstAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the first element of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the first element in source.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • FirstOrDefaultAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    FirstOrDefaultAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously returns the first element of a sequence that satisfies a specified condition or a default value if no such element is found.

    public static Task<TSource> FirstOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function FirstOrDefaultAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the first element of.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test each element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains default ( TSource ) if source is empty or if no element passes the test specified by predicate ; otherwise, the first element in source that passes the test specified by predicate.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • FirstOrDefaultAsync<TSource>(IQueryable<TSource>, CancellationToken)
    FirstOrDefaultAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the first element of a sequence, or a default value if the sequence contains no elements.

    public static Task<TSource> FirstOrDefaultAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function FirstOrDefaultAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the first element of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains default ( TSource ) if source is empty; otherwise, the first element in source.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • ForEachAsync<T>(IQueryable<T>, Action<T>, CancellationToken)
    ForEachAsync(Of T)(IQueryable(Of T), Action(Of T), CancellationToken)

    Asynchronously enumerates the query results and performs the specified action on each element.

    public static Task ForEachAsync<T>(this IQueryable<T> source, Action<T> action, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function ForEachAsync(Of T)(source As IQueryable(Of T), action As Action(Of T), cancellationToken As CancellationToken = Nothing) As Task

    Parameters

    • source
      System.Linq.IQueryable<T><T>
      System.Linq.IQueryable<T>(Of T)

      An System.Linq.IQueryable<T> to enumerate.

    • action
      System.Action<T><T>
      System.Action<T>(Of T)

      The action to perform on each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task
      System.Threading.Tasks.Task

      A task that represents the asynchronous operation.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • Include<TEntity>(IQueryable<TEntity>, String)
    Include(Of TEntity)(IQueryable(Of TEntity), String)

    Specifies related entities to include in the query results. The navigation property to be included is specified starting with the type of entity being queried (TEntity). Further navigation properties to be included can be appended, separated by the '.' character.

    public static IQueryable<TEntity> Include<TEntity>(this IQueryable<TEntity> source, string navigationPropertyPath)where TEntity : class<ExtensionAttribute>
    Public Shared Function Include(Of TEntity As Class)(source As IQueryable(Of TEntity), navigationPropertyPath As String) As IQueryable(Of TEntity)

    Parameters

    • source
      System.Linq.IQueryable<T><TEntity>
      System.Linq.IQueryable<T>(Of TEntity)

      The source query.

    • navigationPropertyPath
      System.String
      System.String

      A string of '.' separated navigation property names to be included.

    Returns

    • System.Linq.IQueryable<T><TEntity>
      System.Linq.IQueryable<T>(Of TEntity)

      A new query with the related data included.

    Example

    The following query shows including a single level of related entities.

        context.Blogs.Include("Posts");

    The following query shows including two levels of entities on the same branch.

        context.Blogs.Include("Posts.Tags");

    The following query shows including multiple levels and branches of related data.

        context.Blogs
            .Include("Posts.Tags.TagInfo')
            .Include("Contributors");

  • Include<TEntity, TProperty>(IQueryable<TEntity>, Expression<Func<TEntity, TProperty>>)
    Include(Of TEntity, TProperty)(IQueryable(Of TEntity), Expression(Of Func(Of TEntity, TProperty)))

    Specifies related entities to include in the query results. The navigation property to be included is specified starting with the type of entity being queried (TEntity). If you wish to include additional types based on the navigation properties of the type being included, then chain a call to

    ThenInclude<TEntity, TPreviousProperty, TProperty>(IIncludableQueryable<TEntity, IEnumerable<TPreviousProperty>>, Expression<Func<TPreviousProperty, TProperty>>) after this call.

    public static IIncludableQueryable<TEntity, TProperty> Include<TEntity, TProperty>(this IQueryable<TEntity> source, Expression<Func<TEntity, TProperty>> navigationPropertyPath)where TEntity : class<ExtensionAttribute>
    Public Shared Function Include(Of TEntity As Class, TProperty)(source As IQueryable(Of TEntity), navigationPropertyPath As Expression(Of Func(Of TEntity, TProperty))) As IIncludableQueryable(Of TEntity, TProperty)

    Parameters

    • source
      System.Linq.IQueryable<T><TEntity>
      System.Linq.IQueryable<T>(Of TEntity)

      The source query.

    • navigationPropertyPath
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TEntity, TProperty>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TEntity, TProperty))

      A lambda expression representing the navigation property to be included (t => t.Property1).

    Returns

    Example

    The following query shows including a single level of related entities.

        context.Blogs.Include(blog => blog.Posts);

    The following query shows including two levels of entities on the same branch.

        context.Blogs
            .Include(blog => blog.Posts).ThenInclude(post => post.Tags);

    The following query shows including multiple levels and branches of related data.

        context.Blogs
            .Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo)
            .Include(blog => blog.Contributors);

  • LastAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    LastAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously returns the last element of a sequence that satisfies a specified condition.

    public static Task<TSource> LastAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function LastAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the last element of.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test each element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the last element in source that passes the test in predicate.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • LastAsync<TSource>(IQueryable<TSource>, CancellationToken)
    LastAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the last element of a sequence.

    public static Task<TSource> LastAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function LastAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the last element of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the last element in source.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • LastOrDefaultAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    LastOrDefaultAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously returns the last element of a sequence that satisfies a specified condition or a default value if no such element is found.

    public static Task<TSource> LastOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function LastOrDefaultAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the last element of.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test each element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains default ( TSource ) if source is empty or if no element passes the test specified by predicate ; otherwise, the last element in source that passes the test specified by predicate.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • LastOrDefaultAsync<TSource>(IQueryable<TSource>, CancellationToken)
    LastOrDefaultAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the last element of a sequence, or a default value if the sequence contains no elements.

    public static Task<TSource> LastOrDefaultAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function LastOrDefaultAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the last element of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains default ( TSource ) if source is empty; otherwise, the last element in source.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • Load<TSource>(IQueryable<TSource>)
    Load(Of TSource)(IQueryable(Of TSource))

    Enumerates the query. When using Entity Framework, this causes the results of the query to be loaded into the associated context. This is equivalent to calling ToList and then throwing away the list (without the overhead of actually creating the list).

    public static void Load<TSource>(this IQueryable<TSource> source)<ExtensionAttribute>
    Public Shared Sub Load(Of TSource)(source As IQueryable(Of TSource))

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      The source query.

  • LoadAsync<TSource>(IQueryable<TSource>, CancellationToken)
    LoadAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously enumerates the query. When using Entity Framework, this causes the results of the query to be loaded into the associated context. This is equivalent to calling ToList and then throwing away the list (without the overhead of actually creating the list).

    public static Task LoadAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function LoadAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      The source query.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task
      System.Threading.Tasks.Task

      A task that represents the asynchronous operation.

  • LongCountAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    LongCountAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously returns an System.Int64 that represents the number of elements in a sequence that satisfy a condition.

    public static Task<long> LongCountAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function LongCountAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of Long)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> that contains the elements to be counted.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test each element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Int64>
      System.Threading.Tasks.Task<TResult>(Of System.Int64)

      A task that represents the asynchronous operation. The task result contains the number of elements in the sequence that satisfy the condition in the predicate function.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • LongCountAsync<TSource>(IQueryable<TSource>, CancellationToken)
    LongCountAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns an System.Int64 that represents the total number of elements in a sequence.

    public static Task<long> LongCountAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function LongCountAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of Long)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> that contains the elements to be counted.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Int64>
      System.Threading.Tasks.Task<TResult>(Of System.Int64)

      A task that represents the asynchronous operation. The task result contains the number of elements in the input sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • MaxAsync<TSource>(IQueryable<TSource>, CancellationToken)
    MaxAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the maximum value of a sequence.

    public static Task<TSource> MaxAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function MaxAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> that contains the elements to determine the maximum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the maximum value in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • MaxAsync<TSource, TResult>(IQueryable<TSource>, Expression<Func<TSource, TResult>>, CancellationToken)
    MaxAsync(Of TSource, TResult)(IQueryable(Of TSource), Expression(Of Func(Of TSource, TResult)), CancellationToken)

    Asynchronously invokes a projection function on each element of a sequence and returns the maximum resulting value.

    public static Task<TResult> MaxAsync<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function MaxAsync(Of TSource, TResult)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, TResult)), cancellationToken As CancellationToken = Nothing) As Task(Of TResult)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> that contains the elements to determine the maximum of.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, TResult>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, TResult))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TResult>
      System.Threading.Tasks.Task<TResult>(Of TResult)

      A task that represents the asynchronous operation. The task result contains the maximum value in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • MinAsync<TSource>(IQueryable<TSource>, CancellationToken)
    MinAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the minimum value of a sequence.

    public static Task<TSource> MinAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function MinAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> that contains the elements to determine the minimum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • MinAsync<TSource, TResult>(IQueryable<TSource>, Expression<Func<TSource, TResult>>, CancellationToken)
    MinAsync(Of TSource, TResult)(IQueryable(Of TSource), Expression(Of Func(Of TSource, TResult)), CancellationToken)

    Asynchronously invokes a projection function on each element of a sequence and returns the minimum resulting value.

    public static Task<TResult> MinAsync<TSource, TResult>(this IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function MinAsync(Of TSource, TResult)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, TResult)), cancellationToken As CancellationToken = Nothing) As Task(Of TResult)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> that contains the elements to determine the minimum of.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, TResult>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, TResult))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TResult>
      System.Threading.Tasks.Task<TResult>(Of TResult)

      A task that represents the asynchronous operation. The task result contains the minimum value in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SingleAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    SingleAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

    public static Task<TSource> SingleAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SingleAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the single element of.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test an element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the single element of the input sequence that satisfies the condition in predicate.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SingleAsync<TSource>(IQueryable<TSource>, CancellationToken)
    SingleAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.

    public static Task<TSource> SingleAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SingleAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the single element of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the single element of the input sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SingleOrDefaultAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Boolean>>, CancellationToken)
    SingleOrDefaultAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Boolean)), CancellationToken)

    Asynchronously returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition.

    public static Task<TSource> SingleOrDefaultAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SingleOrDefaultAsync(Of TSource)(source As IQueryable(Of TSource), predicate As Expression(Of Func(Of TSource, Boolean)), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the single element of.

    • predicate
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Boolean>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Boolean))

      A function to test an element for a condition.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the single element of the input sequence that satisfies the condition in predicate, or default ( TSource ) if no such element is found.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SingleOrDefaultAsync<TSource>(IQueryable<TSource>, CancellationToken)
    SingleOrDefaultAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence.

    public static Task<TSource> SingleOrDefaultAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SingleOrDefaultAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to return the single element of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource>
      System.Threading.Tasks.Task<TResult>(Of TSource)

      A task that represents the asynchronous operation. The task result contains the single element of the input sequence, or default ( TSource) if the sequence contains no elements.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Decimal>, CancellationToken)
    SumAsync(IQueryable(Of Decimal), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<decimal> SumAsync(this IQueryable<decimal> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Decimal), cancellationToken As CancellationToken = Nothing) As Task(Of Decimal)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Decimal>
      System.Linq.IQueryable<T>(Of System.Decimal)

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Decimal>
      System.Threading.Tasks.Task<TResult>(Of System.Decimal)

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Double>, CancellationToken)
    SumAsync(IQueryable(Of Double), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<double> SumAsync(this IQueryable<double> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Double), cancellationToken As CancellationToken = Nothing) As Task(Of Double)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Double>
      System.Linq.IQueryable<T>(Of System.Double)

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Double>
      System.Threading.Tasks.Task<TResult>(Of System.Double)

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Int32>, CancellationToken)
    SumAsync(IQueryable(Of Int32), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<int> SumAsync(this IQueryable<int> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Integer), cancellationToken As CancellationToken = Nothing) As Task(Of Integer)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Int32>
      System.Linq.IQueryable<T>(Of System.Int32)

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Int32>
      System.Threading.Tasks.Task<TResult>(Of System.Int32)

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Int64>, CancellationToken)
    SumAsync(IQueryable(Of Int64), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<long> SumAsync(this IQueryable<long> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Long), cancellationToken As CancellationToken = Nothing) As Task(Of Long)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Int64>
      System.Linq.IQueryable<T>(Of System.Int64)

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Int64>
      System.Threading.Tasks.Task<TResult>(Of System.Int64)

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Nullable<Decimal>>, CancellationToken)
    SumAsync(IQueryable(Of Nullable(Of Decimal)), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<decimal ? > SumAsync(this IQueryable<decimal ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Decimal?), cancellationToken As CancellationToken = Nothing) As Task(Of Decimal?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Decimal>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Decimal))

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Decimal>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Decimal))

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Nullable<Double>>, CancellationToken)
    SumAsync(IQueryable(Of Nullable(Of Double)), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<double ? > SumAsync(this IQueryable<double ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Double?), cancellationToken As CancellationToken = Nothing) As Task(Of Double?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Double>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Double))

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Double>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Double))

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Nullable<Int32>>, CancellationToken)
    SumAsync(IQueryable(Of Nullable(Of Int32)), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<int ? > SumAsync(this IQueryable<int ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Integer?), cancellationToken As CancellationToken = Nothing) As Task(Of Integer?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Int32>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Int32))

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Int32>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Int32))

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Nullable<Int64>>, CancellationToken)
    SumAsync(IQueryable(Of Nullable(Of Int64)), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<long ? > SumAsync(this IQueryable<long ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Long?), cancellationToken As CancellationToken = Nothing) As Task(Of Long?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Int64>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Int64))

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Int64>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Int64))

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Nullable<Single>>, CancellationToken)
    SumAsync(IQueryable(Of Nullable(Of Single)), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<float ? > SumAsync(this IQueryable<float ? > source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Single?), cancellationToken As CancellationToken = Nothing) As Task(Of Single?)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Nullable<T><System.Single>>
      System.Linq.IQueryable<T>(Of System.Nullable<T>(Of System.Single))

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Single>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Single))

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync(IQueryable<Single>, CancellationToken)
    SumAsync(IQueryable(Of Single), CancellationToken)

    Asynchronously computes the sum of a sequence of values.

    public static Task<float> SumAsync(this IQueryable<float> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(source As IQueryable(Of Single), cancellationToken As CancellationToken = Nothing) As Task(Of Single)

    Parameters

    • source
      System.Linq.IQueryable<T><System.Single>
      System.Linq.IQueryable<T>(Of System.Single)

      A sequence of values to calculate the sum of.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Single>
      System.Threading.Tasks.Task<TResult>(Of System.Single)

      A task that represents the asynchronous operation. The task result contains the sum of the values in the sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Decimal>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Decimal)), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<decimal> SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Decimal)), cancellationToken As CancellationToken = Nothing) As Task(Of Decimal)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Decimal>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Decimal))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Decimal>
      System.Threading.Tasks.Task<TResult>(Of System.Decimal)

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Double>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Double)), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<double> SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Double)), cancellationToken As CancellationToken = Nothing) As Task(Of Double)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Double>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Double))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Double>
      System.Threading.Tasks.Task<TResult>(Of System.Double)

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Int32>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Int32)), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<int> SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Integer)), cancellationToken As CancellationToken = Nothing) As Task(Of Integer)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Int32>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Int32))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Int32>
      System.Threading.Tasks.Task<TResult>(Of System.Int32)

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Int64>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Int64)), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<long> SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Long)), cancellationToken As CancellationToken = Nothing) As Task(Of Long)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Int64>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Int64))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Int64>
      System.Threading.Tasks.Task<TResult>(Of System.Int64)

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Decimal>>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Decimal))), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<decimal ? > SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, decimal ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Decimal?)), cancellationToken As CancellationToken = Nothing) As Task(Of Decimal?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Decimal>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Decimal)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Decimal>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Decimal))

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Double>>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Double))), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<double ? > SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, double ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Double?)), cancellationToken As CancellationToken = Nothing) As Task(Of Double?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Double>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Double)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Double>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Double))

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Int32>>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Int32))), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<int ? > SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, int ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Integer?)), cancellationToken As CancellationToken = Nothing) As Task(Of Integer?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Int32>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Int32)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Int32>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Int32))

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Int64>>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Int64))), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<long ? > SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, long ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Long?)), cancellationToken As CancellationToken = Nothing) As Task(Of Long?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Int64>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Int64)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Int64>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Int64))

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Nullable<Single>>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Nullable(Of Single))), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<float ? > SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float ? >> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Single?)), cancellationToken As CancellationToken = Nothing) As Task(Of Single?)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Nullable<T><System.Single>>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Nullable<T>(Of System.Single)))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Nullable<T><System.Single>>
      System.Threading.Tasks.Task<TResult>(Of System.Nullable<T>(Of System.Single))

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, Single>>, CancellationToken)
    SumAsync(Of TSource)(IQueryable(Of TSource), Expression(Of Func(Of TSource, Single)), CancellationToken)

    Asynchronously computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence.

    public static Task<float> SumAsync<TSource>(this IQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function SumAsync(Of TSource)(source As IQueryable(Of TSource), selector As Expression(Of Func(Of TSource, Single)), cancellationToken As CancellationToken = Nothing) As Task(Of Single)

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      A sequence of values of type TSource.

    • selector
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TSource, System.Single>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TSource, System.Single))

      A projection function to apply to each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Single>
      System.Threading.Tasks.Task<TResult>(Of System.Single)

      A task that represents the asynchronous operation. The task result contains the sum of the projected values..

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • ThenInclude<TEntity, TPreviousProperty, TProperty>(IIncludableQueryable<TEntity, TPreviousProperty>, Expression<Func<TPreviousProperty, TProperty>>)
    ThenInclude(Of TEntity, TPreviousProperty, TProperty)(IIncludableQueryable(Of TEntity, TPreviousProperty), Expression(Of Func(Of TPreviousProperty, TProperty)))

    Specifies additional related data to be further included based on a related type that was just included.

    public static IIncludableQueryable<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>(this IIncludableQueryable<TEntity, TPreviousProperty> source, Expression<Func<TPreviousProperty, TProperty>> navigationPropertyPath)where TEntity : class<ExtensionAttribute>
    Public Shared Function ThenInclude(Of TEntity As Class, TPreviousProperty, TProperty)(source As IIncludableQueryable(Of TEntity, TPreviousProperty), navigationPropertyPath As Expression(Of Func(Of TPreviousProperty, TProperty))) As IIncludableQueryable(Of TEntity, TProperty)

    Parameters

    • source
      IIncludableQueryable<TEntity, TProperty><TEntity, TPreviousProperty>
      IIncludableQueryable<TEntity, TProperty>(Of TEntity, TPreviousProperty)

      The source query.

    • navigationPropertyPath
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TPreviousProperty, TProperty>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TPreviousProperty, TProperty))

      A lambda expression representing the navigation property to be included (t => t.Property1).

    Returns

    Example

    The following query shows including a single level of related entities.

        context.Blogs.Include(blog => blog.Posts);

    The following query shows including two levels of entities on the same branch.

        context.Blogs
            .Include(blog => blog.Posts).ThenInclude(post => post.Tags);

    The following query shows including multiple levels and branches of related data.

        context.Blogs
            .Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo)
            .Include(blog => blog.Contributors);

  • ThenInclude<TEntity, TPreviousProperty, TProperty>(IIncludableQueryable<TEntity, IEnumerable<TPreviousProperty>>, Expression<Func<TPreviousProperty, TProperty>>)
    ThenInclude(Of TEntity, TPreviousProperty, TProperty)(IIncludableQueryable(Of TEntity, IEnumerable(Of TPreviousProperty)), Expression(Of Func(Of TPreviousProperty, TProperty)))

    Specifies additional related data to be further included based on a related type that was just included.

    public static IIncludableQueryable<TEntity, TProperty> ThenInclude<TEntity, TPreviousProperty, TProperty>(this IIncludableQueryable<TEntity, IEnumerable<TPreviousProperty>> source, Expression<Func<TPreviousProperty, TProperty>> navigationPropertyPath)where TEntity : class<ExtensionAttribute>
    Public Shared Function ThenInclude(Of TEntity As Class, TPreviousProperty, TProperty)(source As IIncludableQueryable(Of TEntity, IEnumerable(Of TPreviousProperty)), navigationPropertyPath As Expression(Of Func(Of TPreviousProperty, TProperty))) As IIncludableQueryable(Of TEntity, TProperty)

    Parameters

    • source
      IIncludableQueryable<TEntity, TProperty><TEntity, System.Collections.Generic.IEnumerable<T><TPreviousProperty>>
      IIncludableQueryable<TEntity, TProperty>(Of TEntity, System.Collections.Generic.IEnumerable<T>(Of TPreviousProperty))

      The source query.

    • navigationPropertyPath
      System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TPreviousProperty, TProperty>>
      System.Linq.Expressions.Expression<TDelegate>(Of System.Func<T, TResult>(Of TPreviousProperty, TProperty))

      A lambda expression representing the navigation property to be included (t => t.Property1).

    Returns

    Example

    The following query shows including a single level of related entities.

        context.Blogs.Include(blog => blog.Posts);

    The following query shows including two levels of entities on the same branch.

        context.Blogs
            .Include(blog => blog.Posts).ThenInclude(post => post.Tags);

    The following query shows including multiple levels and branches of related data.

        context.Blogs
            .Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo)
            .Include(blog => blog.Contributors);

  • ToArrayAsync<TSource>(IQueryable<TSource>, CancellationToken)
    ToArrayAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously creates an array from an System.Linq.IQueryable<T> by enumerating it asynchronously.

    public static Task<TSource[]> ToArrayAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function ToArrayAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of TSource())

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to create an array from.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><TSource[]>
      System.Threading.Tasks.Task<TResult>(Of TSource())

      A task that represents the asynchronous operation. The task result contains an array that contains elements from the input sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • ToDictionaryAsync<TSource, TKey>(IQueryable<TSource>, Func<TSource, TKey>, IEqualityComparer<TKey>, CancellationToken)
    ToDictionaryAsync(Of TSource, TKey)(IQueryable(Of TSource), Func(Of TSource, TKey), IEqualityComparer(Of TKey), CancellationToken)

    Creates a System.Collections.Generic.Dictionary<TKey, TValue> from an System.Linq.IQueryable<T> by enumerating it asynchronously according to a specified key selector function and a comparer.

    public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IQueryable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function ToDictionaryAsync(Of TSource, TKey)(source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey), comparer As IEqualityComparer(Of TKey), cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of TKey, TSource))

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to create a System.Collections.Generic.Dictionary<TKey, TValue> from.

    • keySelector
      System.Func<T, TResult><TSource, TKey>
      System.Func<T, TResult>(Of TSource, TKey)

      A function to extract a key from each element.

    • comparer
      System.Collections.Generic.IEqualityComparer<T><TKey>
      System.Collections.Generic.IEqualityComparer<T>(Of TKey)

      An System.Collections.Generic.IEqualityComparer<T> to compare keys.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Collections.Generic.Dictionary<TKey, TValue><TKey, TSource>>
      System.Threading.Tasks.Task<TResult>(Of System.Collections.Generic.Dictionary<TKey, TValue>(Of TKey, TSource))

      A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.Dictionary<TKey, TValue> that contains selected keys and values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • ToDictionaryAsync<TSource, TKey>(IQueryable<TSource>, Func<TSource, TKey>, CancellationToken)
    ToDictionaryAsync(Of TSource, TKey)(IQueryable(Of TSource), Func(Of TSource, TKey), CancellationToken)

    Creates a System.Collections.Generic.Dictionary<TKey, TValue> from an System.Linq.IQueryable<T> by enumerating it asynchronously according to a specified key selector function.

    public static Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IQueryable<TSource> source, Func<TSource, TKey> keySelector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function ToDictionaryAsync(Of TSource, TKey)(source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey), cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of TKey, TSource))

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to create a System.Collections.Generic.Dictionary<TKey, TValue> from.

    • keySelector
      System.Func<T, TResult><TSource, TKey>
      System.Func<T, TResult>(Of TSource, TKey)

      A function to extract a key from each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Collections.Generic.Dictionary<TKey, TValue><TKey, TSource>>
      System.Threading.Tasks.Task<TResult>(Of System.Collections.Generic.Dictionary<TKey, TValue>(Of TKey, TSource))

      A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.Dictionary<TKey, TValue> that contains selected keys and values.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • ToDictionaryAsync<TSource, TKey, TElement>(IQueryable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, IEqualityComparer<TKey>, CancellationToken)
    ToDictionaryAsync(Of TSource, TKey, TElement)(IQueryable(Of TSource), Func(Of TSource, TKey), Func(Of TSource, TElement), IEqualityComparer(Of TKey), CancellationToken)

    Creates a System.Collections.Generic.Dictionary<TKey, TValue> from an System.Linq.IQueryable<T> by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.

    public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IQueryable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function ToDictionaryAsync(Of TSource, TKey, TElement)(source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TElement), comparer As IEqualityComparer(Of TKey), cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of TKey, TElement))

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to create a System.Collections.Generic.Dictionary<TKey, TValue> from.

    • keySelector
      System.Func<T, TResult><TSource, TKey>
      System.Func<T, TResult>(Of TSource, TKey)

      A function to extract a key from each element.

    • elementSelector
      System.Func<T, TResult><TSource, TElement>
      System.Func<T, TResult>(Of TSource, TElement)

      A transform function to produce a result element value from each element.

    • comparer
      System.Collections.Generic.IEqualityComparer<T><TKey>
      System.Collections.Generic.IEqualityComparer<T>(Of TKey)

      An System.Collections.Generic.IEqualityComparer<T> to compare keys.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Collections.Generic.Dictionary<TKey, TValue><TKey, TElement>>
      System.Threading.Tasks.Task<TResult>(Of System.Collections.Generic.Dictionary<TKey, TValue>(Of TKey, TElement))

      A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.Dictionary<TKey, TValue> that contains values of type TElement selected from the input sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • ToDictionaryAsync<TSource, TKey, TElement>(IQueryable<TSource>, Func<TSource, TKey>, Func<TSource, TElement>, CancellationToken)
    ToDictionaryAsync(Of TSource, TKey, TElement)(IQueryable(Of TSource), Func(Of TSource, TKey), Func(Of TSource, TElement), CancellationToken)

    Creates a System.Collections.Generic.Dictionary<TKey, TValue> from an System.Linq.IQueryable<T> by enumerating it asynchronously according to a specified key selector and an element selector function.

    public static Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IQueryable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function ToDictionaryAsync(Of TSource, TKey, TElement)(source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TElement), cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of TKey, TElement))

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to create a System.Collections.Generic.Dictionary<TKey, TValue> from.

    • keySelector
      System.Func<T, TResult><TSource, TKey>
      System.Func<T, TResult>(Of TSource, TKey)

      A function to extract a key from each element.

    • elementSelector
      System.Func<T, TResult><TSource, TElement>
      System.Func<T, TResult>(Of TSource, TElement)

      A transform function to produce a result element value from each element.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Collections.Generic.Dictionary<TKey, TValue><TKey, TElement>>
      System.Threading.Tasks.Task<TResult>(Of System.Collections.Generic.Dictionary<TKey, TValue>(Of TKey, TElement))

      A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.Dictionary<TKey, TValue> that contains values of type TElement selected from the input sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

  • ToListAsync<TSource>(IQueryable<TSource>, CancellationToken)
    ToListAsync(Of TSource)(IQueryable(Of TSource), CancellationToken)

    Asynchronously creates a System.Collections.Generic.List<T> from an System.Linq.IQueryable<T> by enumerating it asynchronously.

    public static Task<List<TSource>> ToListAsync<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = null)<ExtensionAttribute>
    Public Shared Function ToListAsync(Of TSource)(source As IQueryable(Of TSource), cancellationToken As CancellationToken = Nothing) As Task(Of List(Of TSource))

    Parameters

    • source
      System.Linq.IQueryable<T><TSource>
      System.Linq.IQueryable<T>(Of TSource)

      An System.Linq.IQueryable<T> to create a list from.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A System.Threading.CancellationToken to observe while waiting for the task to complete.

    Returns

    • System.Threading.Tasks.Task<TResult><System.Collections.Generic.List<T><TSource>>
      System.Threading.Tasks.Task<TResult>(Of System.Collections.Generic.List<T>(Of TSource))

      A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.List<T> that contains elements from the input sequence.

    Remarks

    Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Details

Assembly

Microsoft.EntityFrameworkCore.dll