Esempio n. 1
0
 /// <summary>
 /// Setting with url, query and path params and toaster settings
 /// </summary>
 /// <param name="url"></param>
 /// <param name="queryParameters"></param>
 /// <param name="pathParameters"></param>
 /// <param name="toasterSettings"></param>
 public HttpSettings(string url, HttpQueryParameters queryParameters, HttpPathParameters pathParameters, ToasterSettings toasterSettings)
 {
     this.SetUrl(url);
     this.QueryParameters = queryParameters ?? new HttpQueryParameters();
     this.PathParameters  = pathParameters ?? new HttpPathParameters();
     this.ToasterSettings = toasterSettings ?? new ToasterSettings();
 }
Esempio n. 2
0
 /// <summary>
 /// Setting with url, query and path params and toaster caption
 /// </summary>
 /// <param name="url"></param>
 /// <param name="queryParameters"></param>
 /// <param name="pathParameters"></param>
 /// <param name="toasterCaption"></param>
 public HttpSettings(string url, HttpQueryParameters queryParameters, HttpPathParameters pathParameters, string toasterCaption)
 {
     this.SetUrl(url);
     this.QueryParameters = queryParameters ?? new HttpQueryParameters();
     this.PathParameters  = pathParameters ?? new HttpPathParameters();
     this.ToasterSettings = string.IsNullOrEmpty(toasterCaption) ? new ToasterSettings() : new ToasterSettings(toasterCaption);
 }
Esempio n. 3
0
        public async Task <List <TList> > GetAll(string orderBy, string direction = "asc")
        {
            var queryParams = new HttpQueryParameters();

            if (!string.IsNullOrEmpty(orderBy))
            {
                queryParams.Add("orderBy", orderBy);
            }

            if (!string.IsNullOrEmpty(direction))
            {
                queryParams.Add("direction", direction);
            }

            var settings = new HttpSettings($"{this.Url}", queryParams, null);

            return(await this.Http.Get <List <TList> >(settings));
        }