|
|
@ -10,7 +10,8 @@ namespace AutoMapper |
|
|
public static IMappingExpression<TSource, TDestination> MapExtraProperties<TSource, TDestination>( |
|
|
public static IMappingExpression<TSource, TDestination> MapExtraProperties<TSource, TDestination>( |
|
|
this IMappingExpression<TSource, TDestination> mappingExpression, |
|
|
this IMappingExpression<TSource, TDestination> mappingExpression, |
|
|
MappingPropertyDefinitionChecks? definitionChecks = null, |
|
|
MappingPropertyDefinitionChecks? definitionChecks = null, |
|
|
string[] ignoredProperties = null) |
|
|
string[] ignoredProperties = null, |
|
|
|
|
|
bool mapToRegularProperties = false) |
|
|
where TDestination : IHasExtraProperties |
|
|
where TDestination : IHasExtraProperties |
|
|
where TSource : IHasExtraProperties |
|
|
where TSource : IHasExtraProperties |
|
|
{ |
|
|
{ |
|
|
@ -34,9 +35,16 @@ namespace AutoMapper |
|
|
|
|
|
|
|
|
return result; |
|
|
return result; |
|
|
}) |
|
|
}) |
|
|
); |
|
|
) |
|
|
|
|
|
.AfterMap((source, destination, context) => |
|
|
|
|
|
{ |
|
|
|
|
|
if (mapToRegularProperties) |
|
|
|
|
|
{ |
|
|
|
|
|
destination.SetExtraPropertiesToRegularProperties(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static IMappingExpression<TSource, TDestination> IgnoreExtraProperties<TSource, TDestination>( |
|
|
public static IMappingExpression<TSource, TDestination> IgnoreExtraProperties<TSource, TDestination>( |
|
|
this IMappingExpression<TSource, TDestination> mappingExpression) |
|
|
this IMappingExpression<TSource, TDestination> mappingExpression) |
|
|
where TDestination : IHasExtraProperties |
|
|
where TDestination : IHasExtraProperties |
|
|
|