Example #1
0
        public string Resolve(IConnectionSettings connectionSettings)
        {
            connectionSettings.ThrowIfNull("connectionSettings");

            string typeName = this.Name;

            if (this.Type == null)
            {
                return(this.Name);
            }
            if (connectionSettings.DefaultTypeNames.TryGetValue(this.Type, out typeName))
            {
                return(typeName);
            }

            if (this.Type != null)
            {
                var att = new PropertyNameResolver().GetElasticPropertyFor(this.Type);
                if (att != null && !att.TypeNameMarker.IsNullOrEmpty())
                {
                    typeName = att.TypeNameMarker.Name;
                }
                else if (att != null && !string.IsNullOrEmpty(att.Name))
                {
                    typeName = att.Name;
                }
                else
                {
                    typeName = connectionSettings.DefaultTypeNameInferrer(this.Type);
                }
                return(typeName);
            }
            return(this.Name);
        }
Example #2
0
 public PathResolver(IConnectionSettings connectionSettings)
 {
     connectionSettings.ThrowIfNull("hasDefaultIndices");
     this._connectionSettings = connectionSettings;
     this._indexNameResolver  = new IndexNameResolver(connectionSettings);
     this._typeNameResolver   = new TypeNameResolver();
     this._idResolver         = new IdResolver();
 }
        public static string Resolve(this IndexNameMarker marker, IConnectionSettings connectionSettings)
        {
            if (marker == null)
                return null;
            connectionSettings.ThrowIfNull("connectionSettings");

            if (marker.Type == null)
                return marker.Name;
            return new IndexNameResolver(connectionSettings).GetIndexForType(marker.Type);
        }
Example #4
0
        public string Resolve(IConnectionSettings connectionSettings)
        {
            connectionSettings.ThrowIfNull("connectionSettings");

            string typeName = this.Name;

            if (this.Type == null)
            {
                return(this.Name);
            }
            return(new IndexNameResolver(connectionSettings).GetIndexForType(this.Type));
        }
        public static string Resolve(this IndexNameMarker marker, IConnectionSettings connectionSettings)
        {
            if (marker == null)
            {
                return(null);
            }
            connectionSettings.ThrowIfNull("connectionSettings");

            if (marker.Type == null)
            {
                return(marker.Name);
            }
            return(new IndexNameResolver(connectionSettings).GetIndexForType(marker.Type));
        }
Example #6
0
 public PathResolver(IConnectionSettings connectionSettings)
 {
     connectionSettings.ThrowIfNull("hasDefaultIndices");
     this._connectionSettings = connectionSettings;
     this.Infer = new ElasticInferrer(this._connectionSettings);
 }
Example #7
0
 public TypeNameResolver(IConnectionSettings connectionSettings)
 {
     connectionSettings.ThrowIfNull("hasDefaultIndices");
     this._connectionSettings   = connectionSettings;
     this._propertyNameResolver = new PropertyNameResolver(this._connectionSettings);
 }
Example #8
0
 public IndexNameResolver(IConnectionSettings connectionSettings)
 {
     connectionSettings.ThrowIfNull("hasDefaultIndices");
     this._connectionSettings = connectionSettings;
 }