diff --git a/Elight.Entity/AuthManageProfile.cs b/Elight.Entity/AuthManageProfile.cs index 45dc2d0..2caa4bd 100644 --- a/Elight.Entity/AuthManageProfile.cs +++ b/Elight.Entity/AuthManageProfile.cs @@ -13,6 +13,8 @@ namespace Elight.Entity { public AuthManageProfile() { + this.CreateCusMap(); + CreateMap().ReverseMap(); CreateMap().ReverseMap(); CreateMap().ReverseMap(); @@ -21,7 +23,7 @@ namespace Elight.Entity CreateMap().ReverseMap(); CreateMap().ReverseMap(); - CreateMap(); + //CreateMap(); CreateMap(); @@ -41,4 +43,22 @@ namespace Elight.Entity CreateMap(); } } + public static class AutoMapperProFileExtension + { + public static void CreateCusMap(this Profile profile) + { + profile.CreateMap().ForAllMembers(opt => + { + opt.UseDestinationValue(); + opt.Condition((s, e, r, t) => + { + if (r == null) + { + return false; + } + else { return true; } + }); + }); + } + } }