Class RelationExtension
- Namespace
- DocuWare.Services.Http.Client
- Assembly
- DocuWare.RestClient.dll
Helpers for handling links.
public static class RelationExtension
- Inheritance
-
RelationExtension
- Inherited Members
Methods
GetLink(IRelations, String)
Gets the link by its name.
public static Link GetLink(this IRelations linkable, string relationName)
Parameters
| Type | Name | Description |
|---|---|---|
| IRelations | linkable | The linkable. |
| String | relationName | Name of the relation. |
Returns
| Type | Description |
|---|---|
| Link | The link, if it exists; |
GetLink(IEnumerable<Link>, String)
Gets the link by its name.
public static Link GetLink(this IEnumerable<Link> links, string relationName)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Link> | links | The links. |
| String | relationName | Name of the relation. |
Returns
| Type | Description |
|---|---|
| Link | The link, if it exists; |
GetRelationUri(IRelations, String)
Gets the URI of the relation specified by the name.
public static string GetRelationUri(this IRelations relations, string relationName)
Parameters
| Type | Name | Description |
|---|---|---|
| IRelations | relations | The relations. |
| String | relationName | Name of the relation. |
Returns
| Type | Description |
|---|---|
| String | The link, if it exists; |
GetRelationUriOrThrow(IRelations, String)
Gets the URI of the relation specified by the name.
public static string GetRelationUriOrThrow(this IRelations relations, string relationName)
Parameters
| Type | Name | Description |
|---|---|---|
| IRelations | relations | The relations. |
| String | relationName | Name of the relation. |
Returns
| Type | Description |
|---|---|
| String |
Exceptions
| Type | Condition |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| IRelations | relations | The relations. |
| String | relationName | Name of the relation. |
Returns
| Type | Description |
|---|---|
| Boolean |
|