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); }
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)); }
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)); }
public static T GetCustomAttribute <T>(this IMemberModel member) { return((T)member.GetCustomAttributes(true).FirstOrDefault(attr => attr is T)); }
public static bool HasCustomAttribute(this IMemberModel member, Type type) { return(member.GetCustomAttributes(true).Any(attr => attr.GetType() == type)); }