public SortedDictionary <string, string> GetRequestGet() { SortedDictionary <string, string> sArray = new SortedDictionary <string, string>(); Microsoft.AspNetCore.Http.IQueryCollection coll = Request.Query; ICollection <string> keys = coll.Keys; foreach (string key in keys) { sArray.Add(key, Request.Query[key]); } return(sArray); }
static IDictionary <string, object> GetParameters(Microsoft.AspNetCore.Http.IQueryCollection query) { if (query == null || query.Count == 0) { return(null); } var parameters = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase); foreach (var entry in query) { parameters.Add(entry.Key, entry.Value.ToString()); } return(parameters); }
public static PageInfo ParseRequest(Microsoft.AspNetCore.Http.HttpRequest request, int totalCount) { PageInfo result = new PageInfo(); string paramStartIndex = null; string paramPageSize = null; Microsoft.AspNetCore.Http.IQueryCollection parameters = request.Query; if (parameters != null) { paramStartIndex = parameters["startIndex"]; paramPageSize = parameters["pageSize"]; } int startIndex, pageSize; if (!int.TryParse(paramStartIndex, out startIndex)) { startIndex = 0; } if (!int.TryParse(paramPageSize, out pageSize)) { pageSize = 20; } result.StartIndex = startIndex; result.TotalCount = totalCount; if (totalCount < 0) { result.ItemsCount = Math.Min(pageSize, Math.Abs(totalCount)); result.AddPreviousNextPageLinks(request, pageSize); result.TotalCount = -1; } else { result.ItemsCount = Math.Max(0, Math.Min((startIndex + pageSize), totalCount) - startIndex); result.AddPreviousNextPageLinks(request, pageSize); } return(result); }
public QueryFeature(Microsoft.AspNetCore.Http.IQueryCollection query) { }
public DotvvmQueryCollection(AspQueryCollection originalQuery) { OriginalQuery = originalQuery; }
public void SetOptionsWithQuery(Microsoft.AspNetCore.Http.IQueryCollection query) { this._includedQuery = Utils.FormatQueryToInclude(query[Constants.HTTP_QUERY_INCLUDE]); this._fields = Utils.FormatQueryToFields(query.Where(m => m.Key.Contains("fields"))); this.MakePagination(string.Join("&", query.Where(q => q.Key != "page").Select(q => q.Key + "=" + q.Value).ToArray())); }