Skip to content

Commit

Permalink
QueryableMethods API fix
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Aug 15, 2019
1 parent 512e1da commit 9a32290
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 88 deletions.
80 changes: 40 additions & 40 deletions src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ public static Task<decimal> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<decimal, Task<decimal>>(QueryableMethods.SumWithoutSelectorMethods[typeof(decimal)], source, cancellationToken);
return ExecuteAsync<decimal, Task<decimal>>(QueryableMethods.GetSumWithoutSelector(typeof(decimal)), source, cancellationToken);
}

/// <summary>
Expand All @@ -836,7 +836,7 @@ public static Task<decimal> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<decimal?, Task<decimal?>>(QueryableMethods.SumWithoutSelectorMethods[typeof(decimal?)], source, cancellationToken);
return ExecuteAsync<decimal?, Task<decimal?>>(QueryableMethods.GetSumWithoutSelector(typeof(decimal?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -866,7 +866,7 @@ public static Task<decimal> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<decimal>>(QueryableMethods.SumWithSelectorMethods[typeof(decimal)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<decimal>>(QueryableMethods.GetSumWithSelector(typeof(decimal)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -896,7 +896,7 @@ public static Task<decimal> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<decimal?>>(QueryableMethods.SumWithSelectorMethods[typeof(decimal?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<decimal?>>(QueryableMethods.GetSumWithSelector(typeof(decimal?)), source, selector, cancellationToken);
}

/// <summary>
Expand All @@ -922,7 +922,7 @@ public static Task<int> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<int, Task<int>>(QueryableMethods.SumWithoutSelectorMethods[typeof(int)], source, cancellationToken);
return ExecuteAsync<int, Task<int>>(QueryableMethods.GetSumWithoutSelector(typeof(int)), source, cancellationToken);
}

/// <summary>
Expand All @@ -948,7 +948,7 @@ public static Task<int> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<int?, Task<int?>>(QueryableMethods.SumWithoutSelectorMethods[typeof(int?)], source, cancellationToken);
return ExecuteAsync<int?, Task<int?>>(QueryableMethods.GetSumWithoutSelector(typeof(int?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -978,7 +978,7 @@ public static Task<int> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<int>>(QueryableMethods.SumWithSelectorMethods[typeof(int)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<int>>(QueryableMethods.GetSumWithSelector(typeof(int)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1008,7 +1008,7 @@ public static Task<int> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<int?>>(QueryableMethods.SumWithSelectorMethods[typeof(int?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<int?>>(QueryableMethods.GetSumWithSelector(typeof(int?)), source, selector, cancellationToken);
}

/// <summary>
Expand All @@ -1034,7 +1034,7 @@ public static Task<long> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<long, Task<long>>(QueryableMethods.SumWithoutSelectorMethods[typeof(long)], source, cancellationToken);
return ExecuteAsync<long, Task<long>>(QueryableMethods.GetSumWithoutSelector(typeof(long)), source, cancellationToken);
}

/// <summary>
Expand All @@ -1060,7 +1060,7 @@ public static Task<long> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<long?, Task<long?>>(QueryableMethods.SumWithoutSelectorMethods[typeof(long?)], source, cancellationToken);
return ExecuteAsync<long?, Task<long?>>(QueryableMethods.GetSumWithoutSelector(typeof(long?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1090,7 +1090,7 @@ public static Task<long> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<long>>(QueryableMethods.SumWithSelectorMethods[typeof(long)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<long>>(QueryableMethods.GetSumWithSelector(typeof(long)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1120,7 +1120,7 @@ public static Task<long> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<long?>>(QueryableMethods.SumWithSelectorMethods[typeof(long?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<long?>>(QueryableMethods.GetSumWithSelector(typeof(long?)), source, selector, cancellationToken);
}

/// <summary>
Expand All @@ -1146,7 +1146,7 @@ public static Task<double> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<double, Task<double>>(QueryableMethods.SumWithoutSelectorMethods[typeof(double)], source, cancellationToken);
return ExecuteAsync<double, Task<double>>(QueryableMethods.GetSumWithoutSelector(typeof(double)), source, cancellationToken);
}

/// <summary>
Expand All @@ -1172,7 +1172,7 @@ public static Task<double> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<double?, Task<double?>>(QueryableMethods.SumWithoutSelectorMethods[typeof(double?)], source, cancellationToken);
return ExecuteAsync<double?, Task<double?>>(QueryableMethods.GetSumWithoutSelector(typeof(double?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1202,7 +1202,7 @@ public static Task<double> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<double>>(QueryableMethods.SumWithSelectorMethods[typeof(double)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<double>>(QueryableMethods.GetSumWithSelector(typeof(double)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1232,7 +1232,7 @@ public static Task<double> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<double?>>(QueryableMethods.SumWithSelectorMethods[typeof(double?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<double?>>(QueryableMethods.GetSumWithSelector(typeof(double?)), source, selector, cancellationToken);
}

/// <summary>
Expand All @@ -1258,7 +1258,7 @@ public static Task<float> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<float, Task<float>>(QueryableMethods.SumWithoutSelectorMethods[typeof(float)], source, cancellationToken);
return ExecuteAsync<float, Task<float>>(QueryableMethods.GetSumWithoutSelector(typeof(float)), source, cancellationToken);
}

/// <summary>
Expand All @@ -1284,7 +1284,7 @@ public static Task<float> SumAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<float?, Task<float?>>(QueryableMethods.SumWithoutSelectorMethods[typeof(float?)], source, cancellationToken);
return ExecuteAsync<float?, Task<float?>>(QueryableMethods.GetSumWithoutSelector(typeof(float?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1314,7 +1314,7 @@ public static Task<float> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<float>>(QueryableMethods.SumWithSelectorMethods[typeof(float)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<float>>(QueryableMethods.GetSumWithSelector(typeof(float)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1344,7 +1344,7 @@ public static Task<float> SumAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<float?>>(QueryableMethods.SumWithSelectorMethods[typeof(float?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<float?>>(QueryableMethods.GetSumWithSelector(typeof(float?)), source, selector, cancellationToken);
}

#endregion
Expand Down Expand Up @@ -1374,7 +1374,7 @@ public static Task<decimal> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<decimal, Task<decimal>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(decimal)], source, cancellationToken);
return ExecuteAsync<decimal, Task<decimal>>(QueryableMethods.GetAverageWithoutSelector(typeof(decimal)), source, cancellationToken);
}

/// <summary>
Expand All @@ -1400,7 +1400,7 @@ public static Task<decimal> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<decimal?, Task<decimal?>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(decimal?)], source, cancellationToken);
return ExecuteAsync<decimal?, Task<decimal?>>(QueryableMethods.GetAverageWithoutSelector(typeof(decimal?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1431,7 +1431,7 @@ public static Task<decimal> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<decimal>>(QueryableMethods.AverageWithSelectorMethods[typeof(decimal)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<decimal>>(QueryableMethods.GetAverageWithSelector(typeof(decimal)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1462,7 +1462,7 @@ public static Task<decimal> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<decimal?>>(QueryableMethods.AverageWithSelectorMethods[typeof(decimal?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<decimal?>>(QueryableMethods.GetAverageWithSelector(typeof(decimal?)), source, selector, cancellationToken);
}

/// <summary>
Expand All @@ -1488,7 +1488,7 @@ public static Task<double> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<int, Task<double>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(int)], source, cancellationToken);
return ExecuteAsync<int, Task<double>>(QueryableMethods.GetAverageWithoutSelector(typeof(int)), source, cancellationToken);
}

/// <summary>
Expand All @@ -1514,7 +1514,7 @@ public static Task<double> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<int?, Task<double?>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(int?)], source, cancellationToken);
return ExecuteAsync<int?, Task<double?>>(QueryableMethods.GetAverageWithoutSelector(typeof(int?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1545,7 +1545,7 @@ public static Task<double> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<double>>(QueryableMethods.AverageWithSelectorMethods[typeof(int)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<double>>(QueryableMethods.GetAverageWithSelector(typeof(int)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1576,7 +1576,7 @@ public static Task<double> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<double?>>(QueryableMethods.AverageWithSelectorMethods[typeof(int?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<double?>>(QueryableMethods.GetAverageWithSelector(typeof(int?)), source, selector, cancellationToken);
}

/// <summary>
Expand All @@ -1602,7 +1602,7 @@ public static Task<double> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<long, Task<double>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(long)], source, cancellationToken);
return ExecuteAsync<long, Task<double>>(QueryableMethods.GetAverageWithoutSelector(typeof(long)), source, cancellationToken);
}

/// <summary>
Expand All @@ -1628,7 +1628,7 @@ public static Task<double> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<long?, Task<double?>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(long?)], source, cancellationToken);
return ExecuteAsync<long?, Task<double?>>(QueryableMethods.GetAverageWithoutSelector(typeof(long?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1659,7 +1659,7 @@ public static Task<double> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<double>>(QueryableMethods.AverageWithSelectorMethods[typeof(long)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<double>>(QueryableMethods.GetAverageWithSelector(typeof(long)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1690,7 +1690,7 @@ public static Task<double> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<double?>>(QueryableMethods.AverageWithSelectorMethods[typeof(long?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<double?>>(QueryableMethods.GetAverageWithSelector(typeof(long?)), source, selector, cancellationToken);
}

/// <summary>
Expand All @@ -1716,7 +1716,7 @@ public static Task<double> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<double, Task<double>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(double)], source, cancellationToken);
return ExecuteAsync<double, Task<double>>(QueryableMethods.GetAverageWithoutSelector(typeof(double)), source, cancellationToken);
}

/// <summary>
Expand All @@ -1742,7 +1742,7 @@ public static Task<double> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<double?, Task<double?>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(double?)], source, cancellationToken);
return ExecuteAsync<double?, Task<double?>>(QueryableMethods.GetAverageWithoutSelector(typeof(double?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1773,7 +1773,7 @@ public static Task<double> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<double>>(QueryableMethods.AverageWithSelectorMethods[typeof(double)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<double>>(QueryableMethods.GetAverageWithSelector(typeof(double)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1804,7 +1804,7 @@ public static Task<double> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<double?>>(QueryableMethods.AverageWithSelectorMethods[typeof(double?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<double?>>(QueryableMethods.GetAverageWithSelector(typeof(double?)), source, selector, cancellationToken);
}

/// <summary>
Expand All @@ -1830,7 +1830,7 @@ public static Task<float> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<float, Task<float>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(float)], source, cancellationToken);
return ExecuteAsync<float, Task<float>>(QueryableMethods.GetAverageWithoutSelector(typeof(float)), source, cancellationToken);
}

/// <summary>
Expand All @@ -1856,7 +1856,7 @@ public static Task<float> AverageAsync(
{
Check.NotNull(source, nameof(source));

return ExecuteAsync<float?, Task<float?>>(QueryableMethods.AverageWithoutSelectorMethods[typeof(float?)], source, cancellationToken);
return ExecuteAsync<float?, Task<float?>>(QueryableMethods.GetAverageWithoutSelector(typeof(float?)), source, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1887,7 +1887,7 @@ public static Task<float> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<float>>(QueryableMethods.AverageWithSelectorMethods[typeof(float)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<float>>(QueryableMethods.GetAverageWithSelector(typeof(float)), source, selector, cancellationToken);
}

/// <summary>
Expand Down Expand Up @@ -1918,7 +1918,7 @@ public static Task<float> AverageAsync<TSource>(
Check.NotNull(source, nameof(source));
Check.NotNull(selector, nameof(selector));

return ExecuteAsync<TSource, Task<float?>>(QueryableMethods.AverageWithSelectorMethods[typeof(float?)], source, selector, cancellationToken);
return ExecuteAsync<TSource, Task<float?>>(QueryableMethods.GetAverageWithSelector(typeof(float?)), source, selector, cancellationToken);
}

#endregion
Expand Down
Loading

0 comments on commit 9a32290

Please sign in to comment.