/// <summary>
 /// Adds a relation with a single link to the embedded resource.
 /// </summary>
 /// <param name="relation">How the link is related to the resource.</param>
 /// <param name="link">A hypermedia link.</param>
 /// <returns>This <see cref="IHalEmbeddedResourceBuilder"/> instance.</returns>
 public IHalEmbeddedResourceBuilder IncludeRelationWithSingleLink ( HalRelation relation, HalLink link ) {
     if (relation == null) {
         throw new ArgumentNullException("relation");
     }
     if (link == null) {
         throw new ArgumentNullException("link");
     }
     _linkCollection.Add(relation, link);
     return this;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Adds a hypermedia relation with a single link to this document.
 /// </summary>
 /// <example>
 /// Sample JSON output:
 /// {
 ///    _links: {
 ///               "self": { "href": "http://mysite.com/" }
 ///            }
 /// }
 /// </example>
 /// <param name="relation">How the link is related to the resource.</param>
 /// <param name="link">A hypermedia link.</param>
 /// <returns>This <see cref="IHalDocumentBuilder"/> instance.</returns>
 public IHalDocumentBuilder IncludeRelationWithSingleLink(HalRelation relation, HalLink link)
 {
     if (relation == null)
     {
         throw new ArgumentNullException("relation");
     }
     if (link == null)
     {
         throw new ArgumentNullException("link");
     }
     _linkCollection.Add(relation, link);
     return(this);
 }