Skip to content

Commit 68f9359

Browse files
authored
Merge pull request #13 from yv989c/feature/provider-validation
fix: better provider validation compatibility
2 parents a815faf + 265b6d4 commit 68f9359

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Version.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>1.1.1</VersionPrefix>
3+
<VersionPrefix>1.1.2</VersionPrefix>
44
</PropertyGroup>
55
</Project>

src/QueryableValues.EF6.SqlServer/QueryableValuesCommandInterceptor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private static void TransformCommand(DbCommand command, DbCommandInterceptionCon
9595
return;
9696
}
9797

98-
if (command is not SqlCommand sqlCommand)
98+
if (command.Connection is not SqlConnection)
9999
{
100100
throw Util.NewOnlyWorksWithSqlServerException();
101101
}
@@ -182,7 +182,7 @@ private static void TransformCommand(DbCommand command, DbCommandInterceptionCon
182182
Cache.Add(originalCommandText, entry, cachePolicy);
183183
}
184184

185-
foreach (SqlParameter parameter in sqlCommand.Parameters)
185+
foreach (SqlParameter parameter in command.Parameters)
186186
{
187187
if (entry.Parameters.TryGetValue(parameter.ParameterName, out SerializationFormat serializationFormat))
188188
{
@@ -196,7 +196,7 @@ private static void TransformCommand(DbCommand command, DbCommandInterceptionCon
196196
}
197197
}
198198

199-
sqlCommand.CommandText = entry.CommandText;
199+
command.CommandText = entry.CommandText;
200200
}
201201

202202
public void NonQueryExecuted(DbCommand command, DbCommandInterceptionContext<int> interceptionContext)

0 commit comments

Comments
 (0)