From f0d417c1195865096c68e5b7d7067e82c0825f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 1 Jun 2020 02:38:42 +0300 Subject: [PATCH] Add IgnoreExtraProperties extension method for automapper mapping. --- .../AutoMapper/AbpAutoMapperExtensibleDtoExtensions.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/framework/src/Volo.Abp.AutoMapper/AutoMapper/AbpAutoMapperExtensibleDtoExtensions.cs b/framework/src/Volo.Abp.AutoMapper/AutoMapper/AbpAutoMapperExtensibleDtoExtensions.cs index 40be84cb6f..d26ec97bf2 100644 --- a/framework/src/Volo.Abp.AutoMapper/AutoMapper/AbpAutoMapperExtensibleDtoExtensions.cs +++ b/framework/src/Volo.Abp.AutoMapper/AutoMapper/AbpAutoMapperExtensibleDtoExtensions.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Volo.Abp.AutoMapper; using Volo.Abp.Data; using Volo.Abp.ObjectExtending; @@ -35,5 +36,13 @@ namespace AutoMapper }) ); } + + public static IMappingExpression IgnoreExtraProperties( + this IMappingExpression mappingExpression) + where TDestination : IHasExtraProperties + where TSource : IHasExtraProperties + { + return mappingExpression.Ignore(x => x.ExtraProperties); + } } } \ No newline at end of file