Table of Contents

Interface IExtensionsAdapter

Namespace
LinqToDB
Assembly
linq2db.dll

Interface to override default implementation of LINQ To DB async operations.

public interface IExtensionsAdapter
Extension Methods

Methods

AllAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Task<bool> AllAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken token)

Parameters

source IQueryable<TSource>
predicate Expression<Func<TSource, bool>>
token CancellationToken

Returns

Task<bool>

Type Parameters

TSource

AnyAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Task<bool> AnyAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken token)

Parameters

source IQueryable<TSource>
predicate Expression<Func<TSource, bool>>
token CancellationToken

Returns

Task<bool>

Type Parameters

TSource

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

Task<bool> AnyAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<bool>

Type Parameters

TSource

AsAsyncEnumerable<TSource>(IQueryable<TSource>)

IAsyncEnumerable<TSource> AsAsyncEnumerable<TSource>(IQueryable<TSource> source)

Parameters

source IQueryable<TSource>

Returns

IAsyncEnumerable<TSource>

Type Parameters

TSource

AverageAsync(IQueryable<decimal>, CancellationToken)

Task<decimal> AverageAsync(IQueryable<decimal> source, CancellationToken token)

Parameters

source IQueryable<decimal>
token CancellationToken

Returns

Task<decimal>

AverageAsync(IQueryable<double>, CancellationToken)

Task<double> AverageAsync(IQueryable<double> source, CancellationToken token)

Parameters

source IQueryable<double>
token CancellationToken

Returns

Task<double>

AverageAsync(IQueryable<int>, CancellationToken)

Task<double> AverageAsync(IQueryable<int> source, CancellationToken token)

Parameters

source IQueryable<int>
token CancellationToken

Returns

Task<double>

AverageAsync(IQueryable<long>, CancellationToken)

Task<double> AverageAsync(IQueryable<long> source, CancellationToken token)

Parameters

source IQueryable<long>
token CancellationToken

Returns

Task<double>

AverageAsync(IQueryable<decimal?>, CancellationToken)

Task<decimal?> AverageAsync(IQueryable<decimal?> source, CancellationToken token)

Parameters

source IQueryable<decimal?>
token CancellationToken

Returns

Task<decimal?>

AverageAsync(IQueryable<double?>, CancellationToken)

Task<double?> AverageAsync(IQueryable<double?> source, CancellationToken token)

Parameters

source IQueryable<double?>
token CancellationToken

Returns

Task<double?>

AverageAsync(IQueryable<int?>, CancellationToken)

Task<double?> AverageAsync(IQueryable<int?> source, CancellationToken token)

Parameters

source IQueryable<int?>
token CancellationToken

Returns

Task<double?>

AverageAsync(IQueryable<long?>, CancellationToken)

Task<double?> AverageAsync(IQueryable<long?> source, CancellationToken token)

Parameters

source IQueryable<long?>
token CancellationToken

Returns

Task<double?>

AverageAsync(IQueryable<float?>, CancellationToken)

Task<float?> AverageAsync(IQueryable<float?> source, CancellationToken token)

Parameters

source IQueryable<float?>
token CancellationToken

Returns

Task<float?>

AverageAsync(IQueryable<float>, CancellationToken)

Task<float> AverageAsync(IQueryable<float> source, CancellationToken token)

Parameters

source IQueryable<float>
token CancellationToken

Returns

Task<float>

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, decimal>>, CancellationToken)

Task<decimal> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, decimal>>
token CancellationToken

Returns

Task<decimal>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, double>>, CancellationToken)

Task<double> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, double>>
token CancellationToken

Returns

Task<double>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, int>>, CancellationToken)

Task<double> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, int>>
token CancellationToken

Returns

Task<double>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, long>>, CancellationToken)

Task<double> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, long>>
token CancellationToken

Returns

Task<double>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, decimal?>>, CancellationToken)

Task<decimal?> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, decimal?>>
token CancellationToken

Returns

Task<decimal?>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, double?>>, CancellationToken)

Task<double?> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, double?>>
token CancellationToken

Returns

Task<double?>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, int?>>, CancellationToken)

Task<double?> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, int?>>
token CancellationToken

Returns

Task<double?>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, long?>>, CancellationToken)

Task<double?> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, long?>>
token CancellationToken

Returns

Task<double?>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, float?>>, CancellationToken)

Task<float?> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, float?>>
token CancellationToken

Returns

Task<float?>

Type Parameters

TSource

AverageAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, float>>, CancellationToken)

Task<float> AverageAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, float>>
token CancellationToken

Returns

Task<float>

Type Parameters

TSource

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

Task<bool> ContainsAsync<TSource>(IQueryable<TSource> source, TSource item, CancellationToken token)

Parameters

source IQueryable<TSource>
item TSource
token CancellationToken

Returns

Task<bool>

Type Parameters

TSource

CountAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Task<int> CountAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken token)

Parameters

source IQueryable<TSource>
predicate Expression<Func<TSource, bool>>
token CancellationToken

Returns

Task<int>

Type Parameters

TSource

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

Task<int> CountAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<int>

Type Parameters

TSource

FirstAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Task<TSource> FirstAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken token)

Parameters

source IQueryable<TSource>
predicate Expression<Func<TSource, bool>>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

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

Task<TSource> FirstAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

FirstOrDefaultAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Task<TSource?> FirstOrDefaultAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken token)

Parameters

source IQueryable<TSource>
predicate Expression<Func<TSource, bool>>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

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

Task<TSource?> FirstOrDefaultAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

ForEachAsync<TSource>(IQueryable<TSource>, Action<TSource>, CancellationToken)

Task ForEachAsync<TSource>(IQueryable<TSource> source, Action<TSource> action, CancellationToken token)

Parameters

source IQueryable<TSource>
action Action<TSource>
token CancellationToken

Returns

Task

Type Parameters

TSource

LongCountAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Task<long> LongCountAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken token)

Parameters

source IQueryable<TSource>
predicate Expression<Func<TSource, bool>>
token CancellationToken

Returns

Task<long>

Type Parameters

TSource

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

Task<long> LongCountAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<long>

Type Parameters

TSource

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

Task<TSource?> MaxAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

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

Task<TResult?> MaxAsync<TSource, TResult>(IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, TResult>>
token CancellationToken

Returns

Task<TResult>

Type Parameters

TSource
TResult

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

Task<TSource?> MinAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

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

Task<TResult?> MinAsync<TSource, TResult>(IQueryable<TSource> source, Expression<Func<TSource, TResult>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, TResult>>
token CancellationToken

Returns

Task<TResult>

Type Parameters

TSource
TResult

SingleAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Task<TSource> SingleAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken token)

Parameters

source IQueryable<TSource>
predicate Expression<Func<TSource, bool>>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

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

Task<TSource> SingleAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

SingleOrDefaultAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, bool>>, CancellationToken)

Task<TSource?> SingleOrDefaultAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, bool>> predicate, CancellationToken token)

Parameters

source IQueryable<TSource>
predicate Expression<Func<TSource, bool>>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

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

Task<TSource?> SingleOrDefaultAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<TSource>

Type Parameters

TSource

SumAsync(IQueryable<decimal>, CancellationToken)

Task<decimal> SumAsync(IQueryable<decimal> source, CancellationToken token)

Parameters

source IQueryable<decimal>
token CancellationToken

Returns

Task<decimal>

SumAsync(IQueryable<double>, CancellationToken)

Task<double> SumAsync(IQueryable<double> source, CancellationToken token)

Parameters

source IQueryable<double>
token CancellationToken

Returns

Task<double>

SumAsync(IQueryable<int>, CancellationToken)

Task<int> SumAsync(IQueryable<int> source, CancellationToken token)

Parameters

source IQueryable<int>
token CancellationToken

Returns

Task<int>

SumAsync(IQueryable<long>, CancellationToken)

Task<long> SumAsync(IQueryable<long> source, CancellationToken token)

Parameters

source IQueryable<long>
token CancellationToken

Returns

Task<long>

SumAsync(IQueryable<decimal?>, CancellationToken)

Task<decimal?> SumAsync(IQueryable<decimal?> source, CancellationToken token)

Parameters

source IQueryable<decimal?>
token CancellationToken

Returns

Task<decimal?>

SumAsync(IQueryable<double?>, CancellationToken)

Task<double?> SumAsync(IQueryable<double?> source, CancellationToken token)

Parameters

source IQueryable<double?>
token CancellationToken

Returns

Task<double?>

SumAsync(IQueryable<int?>, CancellationToken)

Task<int?> SumAsync(IQueryable<int?> source, CancellationToken token)

Parameters

source IQueryable<int?>
token CancellationToken

Returns

Task<int?>

SumAsync(IQueryable<long?>, CancellationToken)

Task<long?> SumAsync(IQueryable<long?> source, CancellationToken token)

Parameters

source IQueryable<long?>
token CancellationToken

Returns

Task<long?>

SumAsync(IQueryable<float?>, CancellationToken)

Task<float?> SumAsync(IQueryable<float?> source, CancellationToken token)

Parameters

source IQueryable<float?>
token CancellationToken

Returns

Task<float?>

SumAsync(IQueryable<float>, CancellationToken)

Task<float> SumAsync(IQueryable<float> source, CancellationToken token)

Parameters

source IQueryable<float>
token CancellationToken

Returns

Task<float>

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, decimal>>, CancellationToken)

Task<decimal> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, decimal>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, decimal>>
token CancellationToken

Returns

Task<decimal>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, double>>, CancellationToken)

Task<double> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, double>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, double>>
token CancellationToken

Returns

Task<double>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, int>>, CancellationToken)

Task<int> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, int>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, int>>
token CancellationToken

Returns

Task<int>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, long>>, CancellationToken)

Task<long> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, long>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, long>>
token CancellationToken

Returns

Task<long>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, decimal?>>, CancellationToken)

Task<decimal?> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, decimal?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, decimal?>>
token CancellationToken

Returns

Task<decimal?>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, double?>>, CancellationToken)

Task<double?> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, double?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, double?>>
token CancellationToken

Returns

Task<double?>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, int?>>, CancellationToken)

Task<int?> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, int?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, int?>>
token CancellationToken

Returns

Task<int?>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, long?>>, CancellationToken)

Task<long?> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, long?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, long?>>
token CancellationToken

Returns

Task<long?>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, float?>>, CancellationToken)

Task<float?> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, float?>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, float?>>
token CancellationToken

Returns

Task<float?>

Type Parameters

TSource

SumAsync<TSource>(IQueryable<TSource>, Expression<Func<TSource, float>>, CancellationToken)

Task<float> SumAsync<TSource>(IQueryable<TSource> source, Expression<Func<TSource, float>> selector, CancellationToken token)

Parameters

source IQueryable<TSource>
selector Expression<Func<TSource, float>>
token CancellationToken

Returns

Task<float>

Type Parameters

TSource

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

Task<TSource[]> ToArrayAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<TSource[]>

Type Parameters

TSource

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

Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(IQueryable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer, CancellationToken token) where TKey : notnull

Parameters

source IQueryable<TSource>
keySelector Func<TSource, TKey>
comparer IEqualityComparer<TKey>
token CancellationToken

Returns

Task<Dictionary<TKey, TSource>>

Type Parameters

TSource
TKey

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

Task<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(IQueryable<TSource> source, Func<TSource, TKey> keySelector, CancellationToken token) where TKey : notnull

Parameters

source IQueryable<TSource>
keySelector Func<TSource, TKey>
token CancellationToken

Returns

Task<Dictionary<TKey, TSource>>

Type Parameters

TSource
TKey

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

Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(IQueryable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken token) where TKey : notnull

Parameters

source IQueryable<TSource>
keySelector Func<TSource, TKey>
elementSelector Func<TSource, TElement>
comparer IEqualityComparer<TKey>
token CancellationToken

Returns

Task<Dictionary<TKey, TElement>>

Type Parameters

TSource
TKey
TElement

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

Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(IQueryable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, CancellationToken token) where TKey : notnull

Parameters

source IQueryable<TSource>
keySelector Func<TSource, TKey>
elementSelector Func<TSource, TElement>
token CancellationToken

Returns

Task<Dictionary<TKey, TElement>>

Type Parameters

TSource
TKey
TElement

ToListAsync<TSource>(IQueryable<TSource>, CancellationToken)

Task<List<TSource>> ToListAsync<TSource>(IQueryable<TSource> source, CancellationToken token)

Parameters

source IQueryable<TSource>
token CancellationToken

Returns

Task<List<TSource>>

Type Parameters

TSource