public static GetEditLink ( this item, bool throwIfNotPresent ) : System.ServiceModel.Syndication.SyndicationLink | ||
item | this | |
throwIfNotPresent | bool | |
return | System.ServiceModel.Syndication.SyndicationLink |
public static SyndicationLink GetEditLink(this SyndicationItem item, bool throwIfNotPresent)
{
if (item == null)
{
throw new ArgumentNullException("item");
}
SyndicationLink editLink = item.Links.Where((link) =>(link.RelationshipType == "edit")).SingleOrDefault();
if (editLink == null && throwIfNotPresent)
{
throw new ArgumentException("The item does not have an edit link");
}
return editLink;
}