public static IResourceLinksBuilder <TParentBuilder, TResource> AddSelfLink <TParentBuilder, TResource>(this IResourceLinksBuilder <TParentBuilder, TResource> resourceLinksBuilder, Func <TResource, bool> predicate) where TResource : class { Contract.Requires(resourceLinksBuilder != null); return(resourceLinksBuilder.AddLink(Keywords.Self, predicate)); }
public static IResourceLinksBuilder <TParentBuilder, TResource> AddCanonicalLink <TParentBuilder, TResource>(this IResourceLinksBuilder <TParentBuilder, TResource> resourceLinksBuilder) where TResource : class { Contract.Requires(resourceLinksBuilder != null); return(resourceLinksBuilder.AddLink(Keywords.Canonical)); }
public static IResourceLinksBuilder <TParentBuilder, TResource> AddSelfLink <TParentBuilder, TResource>(this IResourceLinksBuilder <TParentBuilder, TResource> resourceLinksBuilder, Func <TResource, bool> predicate, IEnumerable <Link> linkCollection) where TResource : class { Contract.Requires(resourceLinksBuilder != null); Contract.Requires(linkCollection != null); return(resourceLinksBuilder.AddLink(Keywords.Self, predicate, linkCollection)); }
public static IResourceLinksBuilder <TParentBuilder, TResource> AddCanonicalLink <TParentBuilder, TResource>(this IResourceLinksBuilder <TParentBuilder, TResource> resourceLinksBuilder, Func <TResource, bool> predicate, Link link) where TResource : class { Contract.Requires(resourceLinksBuilder != null); Contract.Requires(link != null); return(resourceLinksBuilder.AddLink(Keywords.Canonical, predicate, link)); }
public static IResourceLinksBuilder <TParentBuilder, TResource> AddCanonicalLink <TParentBuilder, TResource>(this IResourceLinksBuilder <TParentBuilder, TResource> resourceLinksBuilder, IEnumerable <Link> linkCollection) where TResource : class { Contract.Requires(resourceLinksBuilder != null); Contract.Requires(linkCollection != null); return(resourceLinksBuilder.AddLink(Keywords.Canonical, linkCollection)); }
// PUBLIC METHODS /////////////////////////////////////////////////// #region Extension Methods public static IResourceLinksBuilder <TParentBuilder, TResource> AddLink <TParentBuilder, TResource>(this IResourceLinksBuilder <TParentBuilder, TResource> resourceLinksBuilder, string rel, Func <TResource, bool> predicate, params Link[] linkCollection) where TResource : class { Contract.Requires(resourceLinksBuilder != null); Contract.Requires(linkCollection != null); return(resourceLinksBuilder.AddLink(rel, predicate, linkCollection.AsEnumerable())); }