77using System ;
88using System . Collections . Generic ;
99using System . Linq . Expressions ;
10- using Xtensive . Collections ;
1110using Xtensive . Core ;
1211
1312namespace Xtensive . Orm . Linq . Expressions
1413{
1514 internal class ColumnExpression : ParameterizedExpression ,
1615 IMappedExpression
1716 {
18- public Segment < int > Mapping { get ; private set ; }
17+ internal readonly Segment < int > Mapping ;
1918
2019 public Expression Remap ( int offset , Dictionary < Expression , Expression > processedExpressions )
2120 {
2221 if ( ! CanRemap )
2322 return this ;
24- var mapping = new Segment < int > ( Mapping . Offset + offset , 1 ) ;
25- return new ColumnExpression ( Type , mapping , OuterParameter , DefaultIfEmpty ) ;
23+ var newMapping = new Segment < int > ( Mapping . Offset + offset , 1 ) ;
24+ return new ColumnExpression ( Type , newMapping , OuterParameter , DefaultIfEmpty ) ;
2625 }
2726
2827 public Expression Remap ( int [ ] map , Dictionary < Expression , Expression > processedExpressions )
2928 {
3029 if ( ! CanRemap )
3130 return this ;
32- var mapping = new Segment < int > ( map . IndexOf ( Mapping . Offset ) , 1 ) ;
33- return new ColumnExpression ( Type , mapping , OuterParameter , DefaultIfEmpty ) ;
31+ var newMapping = new Segment < int > ( map . IndexOf ( Mapping . Offset ) , 1 ) ;
32+ return new ColumnExpression ( Type , newMapping , OuterParameter , DefaultIfEmpty ) ;
3433 }
3534
3635 public Expression BindParameter ( ParameterExpression parameter )
@@ -63,13 +62,13 @@ public override string ToString()
6362 // Constructors
6463
6564 protected ColumnExpression (
66- Type type ,
67- Segment < int > mapping ,
68- ParameterExpression parameterExpression ,
65+ Type type ,
66+ in Segment < int > mapping ,
67+ ParameterExpression parameterExpression ,
6968 bool defaultIfEmpty )
7069 : base ( ExtendedExpressionType . Column , type , parameterExpression , defaultIfEmpty )
7170 {
72- Mapping = mapping ;
71+ this . Mapping = mapping ;
7372 }
7473 }
7574}
0 commit comments