@@ -20,21 +20,17 @@ public static class MappingExtensions
2020 public static ITargetSelector < TSource > Map < TSource > ( this TSource source ) => Mapper . Map ( source ) ;
2121
2222 /// <summary>
23- /// Perform a mapping operation on this <paramref name="source"/> object using the <see cref="IMapper"/>
24- /// specified by the <paramref name="mapperSpecifier "/>.
23+ /// Perform a mapping operation on this <paramref name="source"/> object using the given
24+ /// <paramref name="mapper "/>.
2525 /// </summary>
2626 /// <typeparam name="TSource">The type of source object on which to perform the mapping.</typeparam>
2727 /// <param name="source">The source object on which to perform the mapping.</param>
28- /// <param name="mapperSpecifier ">
29- /// A func supplying the <see cref="IMapper"/> instance with which to perform the object creation.
28+ /// <param name="mapper ">
29+ /// The <see cref="IMapper"/> instance with which to perform the object creation.
3030 /// </param>
3131 /// <returns>A TargetSelector with which to specify the type of mapping to perform.</returns>
32- public static ITargetSelector < TSource > Map < TSource > (
33- this TSource source ,
34- Func < MapperSpecifier , IMapper > mapperSpecifier )
35- {
36- return MapperSpecifier . Get ( mapperSpecifier ) . Map ( source ) ;
37- }
32+ public static ITargetSelector < TSource > MapUsing < TSource > ( this TSource source , IMapper mapper )
33+ => mapper . Map ( source ) ;
3834
3935 /// <summary>
4036 /// Perform a deep clone of this <paramref name="instance"/> using the default <see cref="IMapper"/>.
@@ -45,17 +41,14 @@ public static ITargetSelector<TSource> Map<TSource>(
4541 public static T DeepClone < T > ( this T instance ) => Mapper . Default . DeepClone ( instance ) ;
4642
4743 /// <summary>
48- /// Perform a deep clone of this <paramref name="instance"/> using the <see cref="IMapper"/>
49- /// specified by the <paramref name="mapperSpecifier"/>.
44+ /// Perform a deep clone of this <paramref name="instance"/> using the given <paramref name="mapper"/>.
5045 /// </summary>
5146 /// <typeparam name="T">The Type of object to clone.</typeparam>
5247 /// <param name="instance">The object to clone.</param>
53- /// <param name="mapperSpecifier">
54- /// A func supplying the <see cref="IMapper"/> instance with which to perform the deep clone.
55- /// </param>
48+ /// <param name="mapper">The <see cref="IMapper"/> instance with which to perform the deep clone.</param>
5649 /// <returns>A deep clone of this <paramref name="instance"/>.</returns>
57- public static T DeepClone < T > ( this T instance , Func < MapperSpecifier , IMapper > mapperSpecifier )
58- => MapperSpecifier . Get ( mapperSpecifier ) . DeepClone ( instance ) ;
50+ public static T DeepCloneUsing < T > ( this T instance , IMapper mapper )
51+ => mapper . DeepClone ( instance ) ;
5952
6053 /// <summary>
6154 /// Perform a deep clone of this <paramref name="instance"/> using the default <see cref="IMapper"/> and
@@ -87,19 +80,15 @@ public static IFlatteningSelector<TSource> Flatten<TSource>(this TSource source)
8780
8881 /// <summary>
8982 /// Flatten the given <paramref name="source"/> object so it has only value-type or string members,
90- /// using the Mapper specified by the <paramref name="mapperSpecifier "/>.
83+ /// using the given <paramref name="mapper "/>.
9184 /// </summary>
9285 /// <typeparam name="TSource">The type of object to flatten.</typeparam>
9386 /// <param name="source">The object to flatten.</param>
94- /// <param name="mapperSpecifier ">
95- /// A func supplying the <see cref="IMapper"/> instance with which to perform the flattening.
87+ /// <param name="mapper ">
88+ /// The <see cref="IMapper"/> instance with which to perform the flattening.
9689 /// </param>
9790 /// <returns>A FlatteningTypeSelector with which to select the type of flattening to perform.</returns>
98- public static IFlatteningSelector < TSource > Flatten < TSource > (
99- this TSource source ,
100- Func < MapperSpecifier , IMapper > mapperSpecifier )
101- {
102- return MapperSpecifier . Get ( mapperSpecifier ) . Flatten ( source ) ;
103- }
91+ public static IFlatteningSelector < TSource > FlattenUsing < TSource > ( this TSource source , IMapper mapper )
92+ => mapper . Flatten ( source ) ;
10493 }
10594}
0 commit comments