-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathILink.cs
More file actions
39 lines (36 loc) · 1.05 KB
/
ILink.cs
File metadata and controls
39 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
namespace JSONAPI.Documents
{
/// <summary>
/// A link that may be found in a "links object"
/// </summary>
/// <see cref="http://jsonapi.org/format/#document-links"/>
public interface ILink
{
/// <summary>
/// a string containing the link's URL.
/// </summary>
string Href { get; }
/// <summary>
/// a meta object containing non-standard meta-information about the link.
/// </summary>
IMetadata Metadata { get; }
}
/// <summary>
/// Default implementation of ILink
/// </summary>
public class Link : ILink
{
public string Href { get; private set; }
public IMetadata Metadata { get; private set; }
/// <summary>
/// Constructs a link
/// </summary>
/// <param name="href">The URL of the link</param>
/// <param name="metadata">metadata about the link</param>
public Link(string href, IMetadata metadata)
{
Href = href;
Metadata = metadata;
}
}
}