Skip to content

Commit

Permalink
Fix some compilation time warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yang-er committed Dec 12, 2021
1 parent 89dd492 commit 6231a79
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 37 deletions.
5 changes: 3 additions & 2 deletions src/Abstraction/Query/ParameterExtractingExpressionVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,10 @@ private sealed class EvaluatableExpressionFindingExpressionVisitor : ExpressionV
private readonly IEvaluatableExpressionFilter _evaluatableExpressionFilter;
private readonly ISet<ParameterExpression> _allowedParameters = new HashSet<ParameterExpression>();
private readonly IModel _model;

#if EFCORE50 || EFCORE60
private readonly bool _parameterize;
#endif

private bool _evaluatable;
private bool _containsClosure;
Expand All @@ -619,8 +622,6 @@ public EvaluatableExpressionFindingExpressionVisitor(
_model = model;
#if EFCORE50 || EFCORE60
_parameterize = parameterize;
#elif EFCORE31
_parameterize = false;
#endif
}

Expand Down
2 changes: 2 additions & 0 deletions src/MySql/EFCore.Bulk.MySql-3.1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<ItemGroup>
<Compile Include="..\Relational\Provider\**" />
<Compile Remove="..\Relational\Provider\ParameterBasedSqlProcessor.cs" />
<Compile Remove="QueryCompilationContextFactory.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/PostgreSql/EFCore.Bulk.PostgreSql-3.1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<ItemGroup>
<Compile Include="..\Relational\Provider\**" />
<Compile Remove="..\Relational\Provider\ParameterBasedSqlProcessor.cs" />
<Compile Remove="QueryCompilationContextFactory.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 1 addition & 5 deletions src/Relational/Provider/ParameterBasedSqlProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#if EFCORE50 || EFCORE60

using Microsoft.EntityFrameworkCore.Bulk;
using Microsoft.EntityFrameworkCore.Bulk;
using Microsoft.EntityFrameworkCore.Query.SqlExpressions;
using Microsoft.EntityFrameworkCore.Utilities;
using System.Collections.Generic;
Expand Down Expand Up @@ -286,5 +284,3 @@ public virtual RelationalParameterBasedSqlProcessor Create(bool useRelationalNul
=> new RelationalBulkParameterBasedSqlProcessor(_dependencies, useRelationalNulls, _options);
}
}

#endif
8 changes: 0 additions & 8 deletions src/Relational/Reduce/ColumnRewritingVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ public IDisposable Setup(TableReferenceExpression from, TableReferenceExpression
return new ResettingDisposable(this);
}

#if EFCORE60
[Obsolete]
public IDisposable Setup(TableExpressionBase from, TableExpressionBase to)
{
throw new NotImplementedException();
}
#endif

public IDisposable Setup(TableReferenceExpression from, IReadOnlyDictionary<string, Expression> to)
{
_from = Check.NotNull(from, nameof(from));
Expand Down
17 changes: 0 additions & 17 deletions src/Relational/Reduce/ProjectionBindingPruningExpressionVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,6 @@ protected virtual Expression VisitProjectionBinding(ProjectionBindingExpression
}
}

return projectionBindingExpression;
}
#elif EFCORE60
else if (projectionBindingExpression.IndexMap != null)
{
var links = projectionBindingExpression.IndexMap;
if (_processed.Add((IDictionary<IProperty, int>)links))
{
var properties = links.ToList();
foreach (var link in properties)
{
var rawIndex = link.Value;
var property = link.Key;
((IDictionary<IProperty, int>)links)[property] = _remappedIndex[rawIndex];
}
}

return projectionBindingExpression;
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ protected override Expression VisitExtension(Expression node)
{
return new ProjectionBindingExpression(_new, proj.ProjectionMember, proj.Type);
}
#if EFCORE31 || EFCORE50
else if (proj.IndexMap != null)
{
return new ProjectionBindingExpression(_new, proj.IndexMap);
}
#endif
}

return node == _origin ? _new : base.VisitExtension(node);
Expand Down
3 changes: 3 additions & 0 deletions src/SqlServer/EFCore.Bulk.SqlServer-3.1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

<ItemGroup>
<Compile Include="..\Relational\Provider\**" />
<Compile Remove="..\Relational\Provider\ParameterBasedSqlProcessor.cs" />
<Compile Remove="QueryCompilationContextFactory.cs" />
<Compile Remove="QueryableMethodTranslatingExpressionVisitor.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/SqlServer/EFCore.Bulk.SqlServer-5.0.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<ItemGroup>
<Compile Include="..\Relational\Provider\**" />
<Compile Remove="QueryableMethodTranslatingExpressionVisitor.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 1 addition & 5 deletions src/SqlServer/QueryableMethodTranslatingExpressionVisitor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#if EFCORE60

using Microsoft.EntityFrameworkCore.Bulk;
using Microsoft.EntityFrameworkCore.Bulk;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.SqlServer.Query.Internal;
Expand Down Expand Up @@ -100,5 +98,3 @@ public QueryableMethodTranslatingExpressionVisitor Create(QueryCompilationContex
_anonymousExpressionFactory);
}
}

#endif
2 changes: 2 additions & 0 deletions src/Sqlite/EFCore.Bulk.Sqlite-3.1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<ItemGroup>
<Compile Include="..\Relational\Provider\**" />
<Compile Remove="..\Relational\Provider\ParameterBasedSqlProcessor.cs" />
<Compile Remove="QueryCompilationContextFactory.cs" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 6231a79

Please sign in to comment.