Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: IHttpUrl WithParents(this IHttpUrl, int, string, bool, bool)

Declaration

public static IHttpUrl WithParents(
    this IHttpUrl url,
    int levels,
    string pathOrSubdomain,
    bool useSubdomain = false,
    bool retainQueryParams = false
)

Summary

Changes a URL’s subpath or subdomain relative to the specified number of URL resolvers.

Parameters

this IHttpUrlurl The URL to modify.
intlevels The number of URL resolvers to rewind.
stringpathOrSubdomain The new subpath or subdomain, without any slashes or dots.
booluseSubdomain If true, the subdomain is changed; if false (default), the path is changed.
boolretainQueryParams If true, the query parameters are retained; if false (default), they are removed.

Returns

The new URL.