EasyAF_Http_UriExtensions

Provides extension methods for Uri objects to support OData query string construction. Enables fluent API for building OData-compliant URLs with filtering, paging, and sorting capabilities.

Syntax

public static class EasyAF_Http_UriExtensions

Inheritance

Methods

ToODataUri

public static Uri ToODataUri(this Uri uri, bool dollarSign = true, string filter = null, int? top = null, int? skip = null, string orderby = null, string expand = null, string select = null, bool? count = null)
Creates an properly-constructed OData Uri with the correct querystring values, if specified.

Parameters

  • uri Uri: The instance to extend.
  • dollarSign bool: Specifies whether or not the query string name should have a ”$” in it. Defaults to true.
  • filter string: The filter.
  • top int?: An representing the number of records to take.
  • skip int?: An representing the number of records to skip over.
  • orderby string: The orderby.
  • expand string: The expand.
  • select string: The select.
  • count bool?: A representing whether to return a count of the total number of records in the response.

Returns

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