11#if ! LESSTHAN_NET40
2+ using JetBrains . Annotations ;
23using System ;
34using System . Collections . Generic ;
45using System . Linq . Expressions ;
56
6- using JetBrains . Annotations ;
7-
87namespace CodeJam . Mapping
98{
109 /// <summary>
@@ -14,50 +13,50 @@ namespace CodeJam.Mapping
1413 /// <typeparam name="TTo">Type to map to.</typeparam>
1514 /// <example>
1615 /// This example shows how to map one object to another.
17- /// <code source="Blocks\tests \Mapping\Examples\MapTests.cs" region="Example" lang="C#"/>
16+ /// <code source="CodeJam. Blocks.Tests \Mapping\Examples\MapTests.cs" region="Example" lang="C#"/>
1817 /// </example>
1918 [ PublicAPI ]
20- public class Mapper < TFrom , TTo >
19+ public class Mapper < TFrom , TTo >
2120 {
22- private MapperBuilder < TFrom , TTo > _mapperBuilder ;
23- private Expression < Func < TFrom , TTo , IDictionary < object , object > , TTo > > _mapperExpression ;
24- private Expression < Func < TFrom , TTo > > _mapperExpressionEx ;
25- private Func < TFrom , TTo , IDictionary < object , object > , TTo > _mapper ;
26- private Func < TFrom , TTo > _mapperEx ;
21+ private MapperBuilder < TFrom , TTo > _mapperBuilder ;
22+ private Expression < Func < TFrom , TTo , IDictionary < object , object > , TTo > > _mapperExpression ;
23+ private Expression < Func < TFrom , TTo > > _mapperExpressionEx ;
24+ private Func < TFrom , TTo , IDictionary < object , object > , TTo > _mapper ;
25+ private Func < TFrom , TTo > _mapperEx ;
2726
28- internal Mapper ( MapperBuilder < TFrom , TTo > mapperBuilder ) => _mapperBuilder = mapperBuilder ;
27+ internal Mapper ( MapperBuilder < TFrom , TTo > mapperBuilder ) => _mapperBuilder = mapperBuilder ;
2928
3029 /// <summary>
3130 /// Returns a mapper expression to map an object of <i>TFrom</i> type to an object of <i>TTo</i> type.
3231 /// Returned expression is compatible to IQueriable.
3332 /// </summary>
3433 /// <returns>Mapping expression.</returns>
3534 [ Pure , NotNull ]
36- public Expression < Func < TFrom , TTo > > GetMapperExpressionEx ( )
35+ public Expression < Func < TFrom , TTo > > GetMapperExpressionEx ( )
3736 => _mapperExpressionEx ?? ( _mapperExpressionEx = _mapperBuilder . GetMapperExpressionEx ( ) ) ;
3837
3938 /// <summary>
4039 /// Returns a mapper expression to map an object of <i>TFrom</i> type to an object of <i>TTo</i> type.
4140 /// </summary>
4241 /// <returns>Mapping expression.</returns>
4342 [ Pure , NotNull ]
44- public Expression < Func < TFrom , TTo , IDictionary < object , object > , TTo > > GetMapperExpression ( )
43+ public Expression < Func < TFrom , TTo , IDictionary < object , object > , TTo > > GetMapperExpression ( )
4544 => _mapperExpression ?? ( _mapperExpression = _mapperBuilder . GetMapperExpression ( ) ) ;
4645
4746 /// <summary>
4847 /// Returns a mapper to map an object of <i>TFrom</i> type to an object of <i>TTo</i> type.
4948 /// </summary>
5049 /// <returns>Mapping expression.</returns>
5150 [ Pure , NotNull ]
52- public Func < TFrom , TTo > GetMapperEx ( )
51+ public Func < TFrom , TTo > GetMapperEx ( )
5352 => _mapperEx ?? ( _mapperEx = GetMapperExpressionEx ( ) . Compile ( ) ) ;
5453
5554 /// <summary>
5655 /// Returns a mapper to map an object of <i>TFrom</i> type to an object of <i>TTo</i> type.
5756 /// </summary>
5857 /// <returns>Mapping expression.</returns>
5958 [ Pure , NotNull ]
60- public Func < TFrom , TTo , IDictionary < object , object > , TTo > GetMapper ( )
59+ public Func < TFrom , TTo , IDictionary < object , object > , TTo > GetMapper ( )
6160 => _mapper ?? ( _mapper = GetMapperExpression ( ) . Compile ( ) ) ;
6261
6362 /// <summary>
@@ -86,7 +85,7 @@ public TTo Map(TFrom source, TTo destination)
8685 /// <param name="crossReferenceDictionary">Storage for cress references if applied.</param>
8786 /// <returns>Destination object.</returns>
8887 [ Pure ]
89- public TTo Map ( TFrom source , TTo destination , IDictionary < object , object > crossReferenceDictionary )
88+ public TTo Map ( TFrom source , TTo destination , IDictionary < object , object > crossReferenceDictionary )
9089 => GetMapper ( ) ( source , destination , crossReferenceDictionary ) ;
9190 }
9291}
0 commit comments