Esempio n. 1
0
        protected override bool Equals(CompiledIndexField other)
        {
            if (other is JsNestedField jnf)
            {
                if (PropertyName != jnf.PropertyName)
                {
                    return(false);
                }
                return(base.Equals(other));
            }

            return(false);
        }
Esempio n. 2
0
        protected override bool Equals(CompiledIndexField other)
        {
            if (other is NestedField nf)
            {
                if (_path.Length != nf._path.Length)
                {
                    return(false);
                }
                for (int i = 0; i < _path.Length; i++)
                {
                    if (_path[i] != nf._path[i])
                    {
                        return(false);
                    }
                }
                return(base.Equals(other));
            }

            return(false);
        }
Esempio n. 3
0
        public NestedField(string name, string[] path)
            : base(name)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }
            if (path.Length == 0)
            {
                throw new ArgumentException("Value cannot be an empty collection.", nameof(path));
            }

            _path = path;

            if (path.Length == 1)
            {
                _field = new SimpleField(path[0]);
            }
            else
            {
                _field = new NestedField(path[0], path.Skip(1).ToArray());
            }
        }
Esempio n. 4
0
 protected virtual bool Equals(CompiledIndexField other)
 {
     return(string.Equals(Name, other.Name));
 }