AnySerializer.TypeBase.IgnoreObjectName C# (CSharp) Method

IgnoreObjectName() protected method

Returns true if object name should be ignored
protected IgnoreObjectName ( string name, string path, IEnumerable attributes = null ) : bool
name string Property or field name
path string Full path to object
attributes IEnumerable
return bool
        protected bool IgnoreObjectName(string name, string path, IEnumerable<CustomAttributeData> attributes = null)
        {
            var ignoreByNameOrPath = _ignorePropertiesOrPaths?.Contains(name) == true || _ignorePropertiesOrPaths?.Contains(path) == true;
            if (ignoreByNameOrPath)
            {
                return true;
            }
#if FEATURE_CUSTOM_ATTRIBUTES
            if (attributes?.Any(x => !_options.BitwiseHasFlag(SerializerOptions.DisableIgnoreAttributes) && (_ignoreAttributes.Contains(x.AttributeType) || _ignoreAttributes.Contains(x.AttributeType.Name))) == true)
            {
                return true;
            }
#else
            if (attributes?.Any(x => !_options.BitwiseHasFlag(SerializerOptions.DisableIgnoreAttributes) && (_ignoreAttributes.Contains(x.Constructor.DeclaringType) || _ignoreAttributes.Contains(x.Constructor.DeclaringType.Name))) == true)
            {
                return true;
            }
#endif
            return false;
        }
    }