public static SyndicationLink GetSelfLink(this SyndicationFeed feed, bool throwIfNotPresent) { if (feed == null) { throw new ArgumentNullException("feed"); } SyndicationLink selfLink = feed.Links.Where((link) =>(link.RelationshipType == "self")).SingleOrDefault(); if (selfLink == null && throwIfNotPresent) { throw new ArgumentException("The feed does not have a self link"); } return selfLink; }