public string GetLink(IHyperMediaItem obj, string linkType)
        {
            if (obj.Links == null)
            {
                throw new HyperMediaFactoryLinksNullException();
            }

            var link = obj.Links.FirstOrDefault(x => x.Rel == linkType);

            if (link == null)
            {
                throw new HyperMediaFactoryLinksNotFoundException();
            }

            return(link.Href);
        }
Ejemplo n.º 2
0
        public string GetLink(IHyperMediaItem obj, string linkType)
        {
            if (obj.Links == null)
            {
                throw new HyperMediaFactoryLinksNullException();
            }

            var link = obj.Links.FirstOrDefault(x => x.Rel == linkType);

            if (link == null)
            {
                throw new HyperMediaFactoryLinksNotFoundException();
            }

            return link.Href;
        }