Skip to content

Commit 95a34cb

Browse files
committed
CSHARP-1315: Replace int with object in calls to GetMethodInfo when the type really can be anything, not just int.
1 parent 76209b0 commit 95a34cb

File tree

15 files changed

+35
-35
lines changed

15 files changed

+35
-35
lines changed

src/MongoDB.Driver/Linq/Processors/EmbeddedPipeline/MethodCallBinders/DistinctBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ internal sealed class DistinctBinder : IMethodCallBinder<EmbeddedPipelineBinding
2525
{
2626
public static IEnumerable<MethodInfo> GetSupportedMethods()
2727
{
28-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Distinct<int>(null));
29-
yield return MethodHelper.GetMethodDefinition(() => Queryable.Distinct<int>(null));
28+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Distinct<object>(null));
29+
yield return MethodHelper.GetMethodDefinition(() => Queryable.Distinct<object>(null));
3030
}
3131

3232
public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/EmbeddedPipeline/MethodCallBinders/ExceptBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ internal sealed class ExceptBinder : IMethodCallBinder<EmbeddedPipelineBindingCo
2525
{
2626
public static IEnumerable<MethodInfo> GetSupportedMethods()
2727
{
28-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Except<int>(null, null));
29-
yield return MethodHelper.GetMethodDefinition(() => Queryable.Except<int>(null, null));
28+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Except<object>(null, null));
29+
yield return MethodHelper.GetMethodDefinition(() => Queryable.Except<object>(null, null));
3030
}
3131

3232
public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/EmbeddedPipeline/MethodCallBinders/IntersectBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ internal sealed class IntersectBinder : IMethodCallBinder<EmbeddedPipelineBindin
2525
{
2626
public static IEnumerable<MethodInfo> GetSupportedMethods()
2727
{
28-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Intersect<int>(null, null));
29-
yield return MethodHelper.GetMethodDefinition(() => Queryable.Intersect<int>(null, null));
28+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Intersect<object>(null, null));
29+
yield return MethodHelper.GetMethodDefinition(() => Queryable.Intersect<object>(null, null));
3030
}
3131

3232
public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/EmbeddedPipeline/MethodCallBinders/SelectBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ internal sealed class SelectBinder : IMethodCallBinder<EmbeddedPipelineBindingCo
2626
{
2727
public static IEnumerable<MethodInfo> GetSupportedMethods()
2828
{
29-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Select(null, (Func<int, int>)null));
30-
yield return MethodHelper.GetMethodDefinition(() => Queryable.Select(null, (Expression<Func<int, int>>)null));
29+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Select(null, (Func<object, object>)null));
30+
yield return MethodHelper.GetMethodDefinition(() => Queryable.Select(null, (Expression<Func<object, object>>)null));
3131
}
3232

3333
public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/EmbeddedPipeline/MethodCallBinders/ToHashSetBinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal sealed class ToHashSetBinder : IMethodCallBinder<EmbeddedPipelineBindin
2525
{
2626
public static IEnumerable<MethodInfo> GetSupportedMethods()
2727
{
28-
yield return MethodHelper.GetMethodDefinition(() => MongoEnumerable.ToHashSet<int>(null));
28+
yield return MethodHelper.GetMethodDefinition(() => MongoEnumerable.ToHashSet<object>(null));
2929
}
3030

3131
public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/EmbeddedPipeline/MethodCallBinders/UnionBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ internal sealed class UnionBinder : IMethodCallBinder<EmbeddedPipelineBindingCon
2525
{
2626
public static IEnumerable<MethodInfo> GetSupportedMethods()
2727
{
28-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Union<int>(null, null));
29-
yield return MethodHelper.GetMethodDefinition(() => Queryable.Union<int>(null, null));
28+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Union<object>(null, null));
29+
yield return MethodHelper.GetMethodDefinition(() => Queryable.Union<object>(null, null));
3030
}
3131

3232
public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/EmbeddedPipeline/MethodCallBinders/WhereBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ internal sealed class WhereBinder : IMethodCallBinder<EmbeddedPipelineBindingCon
2626
{
2727
public static IEnumerable<MethodInfo> GetSupportedMethods()
2828
{
29-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Where(null, (Func<int, bool>)null));
30-
yield return MethodHelper.GetMethodDefinition(() => Queryable.Where(null, (Expression<Func<int, bool>>)null));
29+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Where(null, (Func<object, bool>)null));
30+
yield return MethodHelper.GetMethodDefinition(() => Queryable.Where(null, (Expression<Func<object, bool>>)null));
3131
}
3232

3333
public Expression Bind(PipelineExpression pipeline, EmbeddedPipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/Pipeline/MethodCallBinders/DistinctBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ internal sealed class DistinctBinder : IMethodCallBinder<PipelineBindingContext>
2525
{
2626
public static IEnumerable<MethodInfo> GetSupportedMethods()
2727
{
28-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Distinct<int>(null));
29-
yield return MethodHelper.GetMethodDefinition(() => Queryable.Distinct<int>(null));
28+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.Distinct<object>(null));
29+
yield return MethodHelper.GetMethodDefinition(() => Queryable.Distinct<object>(null));
3030
}
3131

3232
public Expression Bind(PipelineExpression pipeline, PipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/Pipeline/MethodCallBinders/GroupByBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ internal sealed class GroupByBinder : IMethodCallBinder<PipelineBindingContext>
2929
{
3030
public static IEnumerable<MethodInfo> GetSupportedMethods()
3131
{
32-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.GroupBy<int, int>(null, null));
33-
yield return MethodHelper.GetMethodDefinition(() => Queryable.GroupBy<int, int>(null, null));
32+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.GroupBy<object, object>(null, null));
33+
yield return MethodHelper.GetMethodDefinition(() => Queryable.GroupBy<object, object>(null, null));
3434
}
3535

3636
public Expression Bind(PipelineExpression pipeline, PipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

src/MongoDB.Driver/Linq/Processors/Pipeline/MethodCallBinders/GroupByWithResultSelectorBinder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ internal sealed class GroupByWithResultSelectorBinder : IMethodCallBinder<Pipeli
2828
{
2929
public static IEnumerable<MethodInfo> GetSupportedMethods()
3030
{
31-
yield return MethodHelper.GetMethodDefinition(() => Enumerable.GroupBy(null, null, (Func<int, IEnumerable<int>, int>)null));
32-
yield return MethodHelper.GetMethodDefinition(() => Queryable.GroupBy(null, null, (Expression<Func<int, IEnumerable<int>, int>>)null));
31+
yield return MethodHelper.GetMethodDefinition(() => Enumerable.GroupBy(null, null, (Func<object, IEnumerable<object>, object>)null));
32+
yield return MethodHelper.GetMethodDefinition(() => Queryable.GroupBy(null, null, (Expression<Func<object, IEnumerable<object>, object>>)null));
3333
}
3434

3535
public Expression Bind(PipelineExpression pipeline, PipelineBindingContext bindingContext, MethodCallExpression node, IEnumerable<Expression> arguments)

0 commit comments

Comments
 (0)