public static Func <IPackage, bool> ToDelegate(this VersionRange versionInfo) { if (versionInfo == null) { throw new ArgumentNullException("versionInfo"); } return(versionInfo.ToDelegate <IPackage>(p => p.Version)); }
/// <summary> /// Determines if the specified version is within the version spec /// </summary> public static bool Satisfies(this VersionRange versionSpec, SemanticVersion version) { // The range is unbounded so return true if (versionSpec == null) { return(true); } return(versionSpec.ToDelegate <SemanticVersion>(v => v)(version)); }
public static IEnumerable <IPackage> FindByVersion(this IEnumerable <IPackage> source, VersionRange versionSpec) { if (versionSpec == null) { throw new ArgumentNullException("versionSpec"); } return(source.Where(versionSpec.ToDelegate())); }