Skip to content

Commit 2b285b9

Browse files
committed
QueryFormatter prefer constants to not break code compatibility
1 parent 6315454 commit 2b285b9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Orm/Xtensive.Orm/Orm/Services/QueryFormatter.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ public DbCommand ToDbCommand<T>(IQueryable<T> query)
6969

7070
private CommandPart GetCommandPart<T>(IQueryable<T> query)
7171
{
72-
var translatedQuery = Session.Query.Provider.Translate(query.Expression);
72+
var compilerConfiguration = Session.CompilationService.CreateConfiguration(Session);
73+
compilerConfiguration.PreferTypeIdAsParameter = false;
74+
75+
var translatedQuery = Session.Query.Provider.Translate(query.Expression, compilerConfiguration);
7376
var sqlProvider = translatedQuery.DataSource as SqlProvider;
7477

7578
if (sqlProvider==null)

0 commit comments

Comments
 (0)