private DestilleryDTO CreateLinks(DestilleryDTO destillery) { var idObj = new { id = destillery.Id }; destillery.Links.Add( new LinkDTO(this.urlHelper.Link(nameof(this.GetDestillery), idObj), "destillery_detail", "GET")); return(destillery); }
private WhiskyDetailsDTO CreateLinks(WhiskyDetailsDTO whisky, DestilleryDTO destillery = null) { var idObj = new { id = whisky.Id }; whisky.Links.Add( new LinkDTO(this.urlHelper.Link(nameof(this.GetWhisky), idObj), "self", "GET")); if (destillery != null) { var idObjDest = new { id = destillery.Id }; whisky.Links.Add( new LinkDTO(this.urlHelper.Link(nameof(DestilleryController.GetDestillery), idObjDest), "destillery", "GET")); } return(whisky); }