System.ServiceModel.Syndication.SyndicationFeedExtensions.GetSelfLink C# (CSharp) Method

GetSelfLink() public static method

public static GetSelfLink ( this feed, bool throwIfNotPresent ) : System.ServiceModel.Syndication.SyndicationLink
feed this
throwIfNotPresent bool
return System.ServiceModel.Syndication.SyndicationLink
        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;
        }