Example #1
0
 /// <summary>
 /// Adds an OData "$top" paramater to the querystring with the specified value
 /// </summary>
 /// <param name="url">The instance of <see cref="System.Uri" /> pointing to an OData API endpoint</param>
 /// <param name="top">The number of records to request that the API endpoint returns</param>
 /// <returns>Url with "$top" parameter and specified value.</returns>
 public static Uri AddODataTopParameter(this Uri url, int top)
 {
     return(url.AddParameter("$skip", top.ToString()));
 }
Example #2
0
 /// <summary>
 /// Adds an OData "$skip" paramater to the querystring with the specified value
 /// </summary>
 /// <param name="url">The instance of <see cref="System.Uri" /> pointing to an OData API endpoint</param>
 /// <param name="skip">The number of records to request that the API endpoint skips</param>
 /// <returns>Url with "$skip" parameter and specified value.</returns>
 public static Uri AddODataSkipParameter(this Uri url, int skip)
 {
     return(url.AddParameter("$skip", skip.ToString()));
 }
Example #3
0
 /// <summary>
 /// Adds an OData "$select" paramater to the querystring with the specified value
 /// </summary>
 /// <param name="url">The instance of <see cref="System.Uri" /> pointing to an OData API endpoint</param>
 /// <param name="selectProperty">The property of the data transfer object (DTO) that you would like
 /// the API endpoint to return.</param>
 /// <typeparam name="TDto">The type of the data transfer object (DTO) being requested from
 /// the API endpoint.</typeparam>
 /// <typeparam name="TProperty">The type of the property on the data transfer object (DTO)
 /// that we would like the API endpoint return.</typeparam>
 /// <returns>Url with "$select" parameter and specified value.</returns>
 public static Uri AddODataSelectParameter <TDto, TProperty>(this Uri url, Expression <Func <TDto, TProperty> > selectProperty)
 {
     return(url.AddParameter("$select", selectProperty.Name));
 }
Example #4
0
 /// <summary>
 /// Adds an OData "$count" paramater to the querystring with the specified value
 /// </summary>
 /// <param name="url">The instance of <see cref="System.Uri" /> pointing to an OData API endpoint</param>
 /// <param name="value">True to request a count from the API endpoint, otherwise false</param>
 /// <returns>Url with "$count" parameter.</returns>
 public static Uri AddODataCountParameter(this Uri url, bool value)
 {
     return(url.AddParameter("$count", value.ToString()));
 }
Example #5
0
 /// <summary>
 /// Adds an OData "$orderby" paramater to the querystring with the specified value
 /// </summary>
 /// <param name="url">The instance of <see cref="System.Uri" /> pointing to an OData API endpoint</param>
 /// <param name="orderByProperty">The property of the data transfer object (DTO) on which
 /// you would like the API endpoint to sort.</param>
 /// <typeparam name="TDto">The type of the data transfer object (DTO) being requested from
 /// the API endpoint.</typeparam>
 /// <typeparam name="TProperty">The type of the property on the data transfer object (DTO)
 /// on which we are requesting the API endpoint sort.</typeparam>
 /// <returns>Url with "$orderby" parameter and specified value.</returns>
 public static Uri AddODataOrderByParameter <TDto, TProperty>(this Uri url, Expression <Func <TDto, TProperty> > orderByProperty)
 {
     return(url.AddParameter("$orderby", orderByProperty.Name));
 }