Beispiel #1
0
        //TODO merge with GetDeleteByQueryPathForDynamic
        public string GetPathForTyped <T>(QueryPathDescriptor <T> descriptor, string suffix) where T : class
        {
            string indices;

            if (descriptor._Indices.HasAny())
            {
                indices = string.Join(",", descriptor._Indices);
            }
            else if (descriptor._Indices != null || descriptor._AllIndices)             //if set to empty array asume all
            {
                indices = "_all";
            }
            else
            {
                indices = this.Infer.IndexName <T>();
            }

            var types = this.Infer.TypeName <T>();

            if (descriptor._Types.HasAny())
            {
                types = string.Join(",", descriptor._Types);
            }
            else if (descriptor._Types != null || descriptor._AllTypes)             //if set to empty array assume all
            {
                types = null;
            }

            return(this.SearchPathJoin(indices, types, descriptor.GetUrlParams(), suffix));
        }
Beispiel #2
0
        public string GetDeleteByQueryPathForDynamic(QueryPathDescriptor <dynamic> descriptor, string suffix)
        {
            string indices;

            if (descriptor._Indices.HasAny())
            {
                indices = string.Join(",", descriptor._Indices);
            }
            else if (descriptor._Indices != null || descriptor._AllIndices)             //if set to empty array asume all
            {
                indices = "_all";
            }
            else
            {
                indices = this._connectionSettings.DefaultIndex;
            }

            string types = (descriptor._Types.HasAny()) ? string.Join(",", descriptor._Types) : null;

            return(this.SearchPathJoin(indices, types, descriptor.GetUrlParams(), suffix));
        }