File tree Expand file tree Collapse file tree
Orm/Xtensive.Orm/Orm/Services/QueryBuilding Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // Copyright (C) 2012-2020 Xtensive LLC.
1+ // Copyright (C) 2012-2020 Xtensive LLC.
22// This code is distributed under MIT license terms.
33// See the License.txt file in the project root for more information.
44// Created by: Denis Krjuchkov
@@ -47,9 +47,14 @@ public QueryTranslationResult TranslateQuery<TResult>(IQueryable<TResult> query)
4747
4848 var request = sqlProvider . Request ;
4949
50- return new QueryTranslationResult (
51- request . Statement ,
52- request . ParameterBindings . Select ( b => new QueryParameterBinding ( b ) ) ) ;
50+ if ( request . ParameterBindings is ICollection < Providers . QueryParameterBinding > bindingCollection ) {
51+ return new QueryTranslationResult (
52+ request . Statement ,
53+ bindingCollection . SelectToList ( b => new QueryParameterBinding ( b ) ) ) ;
54+ }
55+ else
56+ return new QueryTranslationResult ( request . Statement ,
57+ request . ParameterBindings . Select ( b => new QueryParameterBinding ( b ) ) . ToList ( ) ) ;
5358 }
5459
5560 /// <summary>
Original file line number Diff line number Diff line change 1- // Copyright (C) 2012 Xtensive LLC.
1+ // Copyright (C) 2012 Xtensive LLC.
22// All rights reserved.
33// For conditions of distribution and use, see license.
44// Created by: Denis Krjuchkov
@@ -27,10 +27,10 @@ public sealed class QueryTranslationResult
2727
2828 // Constructors
2929
30- internal QueryTranslationResult ( ISqlCompileUnit query , IEnumerable < QueryParameterBinding > bindings )
30+ internal QueryTranslationResult ( ISqlCompileUnit query , IList < QueryParameterBinding > bindings )
3131 {
3232 Query = query ;
33- ParameterBindings = bindings . ToList ( ) ;
33+ ParameterBindings = bindings ;
3434 }
3535 }
3636}
You can’t perform that action at this time.
0 commit comments