コード例 #1
0
        public string Resolve(PropertyName property)
        {
            if (property.IsConditionless())
            {
                return(null);
            }
            if (!property.Name.IsNullOrEmpty())
            {
                return(property.Name);
            }

            if (property.Expression != null && !property.CacheableExpression)
            {
                return(Resolve(property.Expression, property.Property));
            }

            if (Properties.TryGetValue(property, out var propertyName))
            {
                return(propertyName);
            }

            propertyName = Resolve(property.Expression, property.Property, true);
            Properties.TryAdd(property, propertyName);
            return(propertyName);
        }
コード例 #2
0
        internal string Resolve(PropertyName property)
        {
            if (property.IsConditionless())
            {
                return(null);
            }
            if (!property.Name.IsNullOrEmpty())
            {
                return(property.Name);
            }
            string f;

            if (this.Properties.TryGetValue(property, out f))
            {
                return(f);
            }
            f = this.Resolve(property.Expression, property.Property);
            this.Properties.TryAdd(property, f);
            return(f);
        }
コード例 #3
0
ファイル: FieldResolver.cs プロジェクト: RossLieberman/NEST
        public string Resolve(PropertyName property)
        {
            if (property.IsConditionless())
            {
                return(null);
            }
            if (!property.Name.IsNullOrEmpty())
            {
                return(property.Name);
            }

            string propertyName;

            if (this.Properties.TryGetValue(property, out propertyName))
            {
                return(propertyName);
            }
            propertyName = this.Resolve(property.Expression, property.Property, true);
            this.Properties.TryAdd(property, propertyName);
            return(propertyName);
        }
コード例 #4
0
        public string PropertyName(PropertyName property)
        {
            if (property.IsConditionless())
            {
                return(null);
            }

            var name = !property.Name.IsNullOrEmpty()
                                ? property.Name
                                : property.Expression != null
                                        ? this.FieldResolver.Resolve(property.Expression)
                                        : property.Property != null
                                                ? this.FieldResolver.Resolve(property.Property)
                                                : null;

            if (name == null)
            {
                throw new ArgumentException("Could not resolve a property name");
            }

            return(name);
        }
コード例 #5
0
        public string Resolve(PropertyName property)
        {
            if (property.IsConditionless())
            {
                return(null);
            }
            if (!property.Name.IsNullOrEmpty())
            {
                if (property.Name.Contains("."))
                {
                    throw new ArgumentException("Property names cannot contain dots.");
                }
                return(property.Name);
            }
            string f;

            if (this.Properties.TryGetValue(property, out f))
            {
                return(f);
            }
            f = this.Resolve(property.Expression, property.Property, true);
            this.Properties.TryAdd(property, f);
            return(f);
        }