Skip to main content

Definition

Assembly: System.Runtime.dll Namespace: System

Syntax

System.Uri

Summary

This type is defined in System.Runtime.

Remarks

See Microsoft documentation for more information about the rest of the API.

Methods

ToODataUri Extension

Extension method from System.EasyAF_Http_UriExtensions
Creates an properly-constructed OData Uri with the correct querystring values, if specified.

Syntax

public static System.Uri ToODataUri(System.Uri uri, bool dollarSign = true, string filter = null, System.Nullable<int> top = null, System.Nullable<int> skip = null, string orderby = null, string expand = null, string select = null, System.Nullable<bool> count = null)

Parameters

NameTypeDescription
uriSystem.UriThe Uri instance to extend.
dollarSignboolSpecifies whether or not the query string name should have a ”$” in it. Defaults to true.
filterstringThe filter.
topSystem.Nullable<int>An Int32 representing the number of records to take.
skipSystem.Nullable<int>An Int32 representing the number of records to skip over.
orderbystringThe orderby.
expandstringThe expand.
selectstringThe select.
countSystem.Nullable<bool>A Boolean representing whether to return a count of the total number of records in the response.

Returns

Type: System.Uri A new Uri instance with a properly-formatted OData-compatible query string.

Remarks

Inspired by https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/OData.cs#L235, but performs better.