C# Class Saule.Serialization.DefaultUrlPathBuilder

Used to build url paths.
Inheritance: IUrlPathBuilder
显示文件 Open project: joukevandermaas/saule Class Usage Examples

Public Methods

Method Description
BuildCanonicalPath ( ApiResource resource ) : string

Returns the UrlPath of the resource, ensuring it starts and ends with '/'

BuildCanonicalPath ( ApiResource resource, string id ) : string

Returns a path in the form `/resource.UrlPath/id/`.

BuildRelationshipPath ( ApiResource resource, string id, ResourceRelationship relationship ) : string

Returns a path in the form `/resource.UrlPath/id/relationships/relationship.UrlPath/`.

BuildRelationshipPath ( ApiResource resource, string id, ResourceRelationship relationship, string relatedResourceId ) : string

Returns a path in the form `/resource.UrlPath/id/relationship.UrlPath/`.

DefaultUrlPathBuilder ( ) : System

Initializes a new instance of the DefaultUrlPathBuilder class.

DefaultUrlPathBuilder ( string prefix ) : System

Initializes a new instance of the DefaultUrlPathBuilder class.

Private Methods

Method Description
DefaultUrlPathBuilder ( string virtualPathRoot, string template ) : System

Method Details

BuildCanonicalPath() public method

Returns the UrlPath of the resource, ensuring it starts and ends with '/'
public BuildCanonicalPath ( ApiResource resource ) : string
resource ApiResource The resource this path refers to.
return string

BuildCanonicalPath() public method

Returns a path in the form `/resource.UrlPath/id/`.
public BuildCanonicalPath ( ApiResource resource, string id ) : string
resource ApiResource The resource this path refers to.
id string The unique id of the resource.
return string

BuildRelationshipPath() public method

Returns a path in the form `/resource.UrlPath/id/relationships/relationship.UrlPath/`.
public BuildRelationshipPath ( ApiResource resource, string id, ResourceRelationship relationship ) : string
resource ApiResource The resource this path is related to.
id string The unique id of the resource.
relationship ResourceRelationship The relationship this path refers to.
return string

BuildRelationshipPath() public method

Returns a path in the form `/resource.UrlPath/id/relationship.UrlPath/`.
public BuildRelationshipPath ( ApiResource resource, string id, ResourceRelationship relationship, string relatedResourceId ) : string
resource ApiResource The resource this path is related to.
id string The unique id of the resource.
relationship ResourceRelationship The relationship this path refers to.
relatedResourceId string The id of the related resource.
return string

DefaultUrlPathBuilder() public method

Initializes a new instance of the DefaultUrlPathBuilder class.
public DefaultUrlPathBuilder ( ) : System
return System

DefaultUrlPathBuilder() public method

Initializes a new instance of the DefaultUrlPathBuilder class.
public DefaultUrlPathBuilder ( string prefix ) : System
prefix string A prefix for all urls generated by this instance of the DefaultUrlPathBuilder class.
return System