System.Reflection.MemberInfo.IsDefined C# (CSharp) Method

IsDefined() public abstract method

public abstract IsDefined ( Type attributeType, bool inherit ) : bool
attributeType Type
inherit bool
return bool
        public abstract bool IsDefined(Type attributeType, bool inherit);
    

Usage Example

        protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
        {
            JsonProperty property = base.CreateProperty(member, memberSerialization);

            if (member.IsDefined(typeof(DisableAuditingAttribute)) || member.IsDefined(typeof(JsonIgnoreAttribute)))
            {
                property.ShouldSerialize = instance => false;
            }

            return property;
        }
All Usage Examples Of System.Reflection.MemberInfo::IsDefined