Table of Contents

Class RelationExtension

Namespace
DocuWare.Services.Http.Client
Assembly
DocuWare.RestClient.dll

Helpers for handling links.

public static class RelationExtension
Inheritance
RelationExtension
Inherited Members

Methods

Gets the link by its name.

public static Link GetLink(this IRelations linkable, string relationName)

Parameters

TypeNameDescription
IRelationslinkable

The linkable.

StringrelationName

Name of the relation.

Returns

TypeDescription
Link

The link, if it exists; null otherwise.

Gets the link by its name.

public static Link GetLink(this IEnumerable<Link> links, string relationName)

Parameters

TypeNameDescription
IEnumerable<Link>links

The links.

StringrelationName

Name of the relation.

Returns

TypeDescription
Link

The link, if it exists; null otherwise.

GetRelationUri(IRelations, String)

Gets the URI of the relation specified by the name.

public static string GetRelationUri(this IRelations relations, string relationName)

Parameters

TypeNameDescription
IRelationsrelations

The relations.

StringrelationName

Name of the relation.

Returns

TypeDescription
String

The link, if it exists; null otherwise.

GetRelationUriOrThrow(IRelations, String)

Gets the URI of the relation specified by the name.

public static string GetRelationUriOrThrow(this IRelations relations, string relationName)

Parameters

TypeNameDescription
IRelationsrelations

The relations.

StringrelationName

Name of the relation.

Returns

TypeDescription
String

Exceptions

TypeCondition
ArgumentException

The specified link is not found.

HasRelationUri(IRelations, String)

Determines whether the specified link exists.

public static bool HasRelationUri(this IRelations relations, string relationName)

Parameters

TypeNameDescription
IRelationsrelations

The relations.

StringrelationName

Name of the relation.

Returns

TypeDescription
Boolean

true if the specified link exists; otherwise, false.