Example #1
0
        /// <summary>
        /// Index object to the default index and the inferred type name for T, using index parameters to further control the operation
        /// </summary>
        public Task <IIndexResponse> IndexAsync <T>(T @object, IndexParameters indexParameters) where T : class
        {
            var path = this.PathResolver.CreateIdOptionalPathFor <T>(@object);

            path = this.PathResolver.AppendParametersToPath(path, indexParameters);
            return(this._indexAsyncToPath(@object, path));
        }
Example #2
0
        /// <summary>
        /// Index object to the specified index and the inferred type name for T, using index parameters to further control the operation
        /// </summary>
        public IIndexResponse Index <T>(T @object, string index, IndexParameters indexParameters) where T : class
        {
            var path = this.PathResolver.CreateIdOptionalPathFor <T>(@object, index);

            path = this.PathResolver.AppendParametersToPath(path, indexParameters);
            return(this._indexToPath <T>(@object, path));
        }
Example #3
0
        public ConnectionStatus Index <T>(T @object, string index, string type, IndexParameters indexParameters) where T : class
        {
            var path = this.CreatePathFor <T>(@object, index, type);

            path = this.AppendParametersToPath(path, indexParameters);
            return(this._indexToPath <T>(@object, path));
        }
Example #4
0
        public void IndexAsync <T>(T @object, string index, string type, int id, IndexParameters indexParameters, Action <ConnectionStatus> continuation) where T : class
        {
            var path = this.CreatePathFor <T>(@object, index, type, id.ToString());

            path = this.AppendParametersToPath(path, indexParameters);
            this._indexAsyncToPath(@object, path, continuation);
        }
Example #5
0
        public void IndexAsync <T>(T @object, IndexParameters indexParameters) where T : class
        {
            var path = this.CreatePathFor <T>(@object);

            path = this.AppendParametersToPath(path, indexParameters);
            this._indexAsyncToPath(@object, path, (s) => { });
        }
Example #6
0
        /// <summary>
        /// Index object to the specified index and the inferred type name for T, using index parameters to further control the operation
        /// </summary>
        public Task <ConnectionStatus> IndexAsync <T>(T @object, string index, IndexParameters indexParameters) where T : class
        {
            var path = this.CreatePathFor <T>(@object, index);

            path = this.AppendParametersToPath(path, indexParameters);
            return(this._indexAsyncToPath(@object, path));
        }
Example #7
0
        private List <string> AppendIndexParameters(List <string> parameters, IndexParameters indexParameters)
        {
            if (indexParameters == null)
            {
                return(parameters);
            }

            if (!indexParameters.Timeout.IsNullOrEmpty())
            {
                parameters.Add("timeout=" + indexParameters.Timeout);
            }

            if (indexParameters.VersionType != VersionType.Internal)             //internal == default
            {
                parameters.Add("version_type=" + indexParameters.VersionType.ToString().ToLower());
            }

            return(parameters);
        }