public static object MapMember(this ResolutionContext context, MemberInfo member, object value, object destination)
 {
     var memberType = member.GetMemberType();
     var destValue = member.GetMemberValue(destination);
     return context.Mapper.Map(value, destValue, value?.GetType() ?? memberType, memberType, context);
 }
 /// <summary>
 /// Determines if a property is different from its default value
 /// </summary>
 /// <param name="target"></param>
 /// <param name="memberInfo"></param>
 /// <returns></returns>
 protected virtual bool IsSpecified(object target, MemberInfo memberInfo)
 {
     object value = memberInfo.GetMemberValue(target);
     if (value == null)
         return false;
     if (Equals(value, TypeConvert.GetDefault(memberInfo.GetMemberType())))
         return false;
     return true;
 }
Exemple #3
0
 protected override object GetSourceMember(MemberInfo member, object target)
 {
     return member.GetMemberValue(target);
 }