예제 #1
0
 private static bool ProcessIgnores(TypeAdapterSettings config, IMemberModel destinationMember)
 {
     if (config.IgnoreMembers.Contains(destinationMember.Name))
         return true;
     var attributes = destinationMember.GetCustomAttributes(true).Select(attr => attr.GetType());
     return config.IgnoreAttributes.Overlaps(attributes);
 }
예제 #2
0
        private static bool ProcessIgnores(TypeAdapterSettings config, IMemberModel destinationMember)
        {
            if (config.IgnoreMembers.Contains(destinationMember.Name))
            {
                return(true);
            }
            var attributes = destinationMember.GetCustomAttributes(true).Select(attr => attr.GetType());

            return(config.IgnoreAttributes.Overlaps(attributes));
        }
예제 #3
0
        private static bool ProcessIgnores(
            TypeAdapterSettings config,
            IMemberModel destinationMember,
            Expression source,
            out LambdaExpression condition)
        {
            if (config.IgnoreMembers.TryGetValue(destinationMember.Name, out condition))
            {
                return(condition == null);
            }

            var attributes = destinationMember.GetCustomAttributes(true).Select(attr => attr.GetType());

            return(config.IgnoreAttributes.Overlaps(attributes));
        }
예제 #4
0
 public static T GetCustomAttribute <T>(this IMemberModel member)
 {
     return((T)member.GetCustomAttributes(true).FirstOrDefault(attr => attr is T));
 }
예제 #5
0
 public static bool HasCustomAttribute(this IMemberModel member, Type type)
 {
     return(member.GetCustomAttributes(true).Any(attr => attr.GetType() == type));
 }