public bool Equals([CanBeNull] INuGetPackage other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(string.Equals(PackageDirectoryName, other.PackageDirectoryName));
 }
示例#2
0
 private static ODataPackage AsODataPackage(INuGetPackage package)
 {
     return(new ODataPackage
     {
         Id = package.Id,
         Version = package.Version,
         Summary = package.Summary,
         IsAbsoluteLatestVersion = package.IsAbsoluteLatestVersion,
         IsLatestVersion = package.IsLatestVersion,
         Published = package.Published,
         Authors = package.Authors,
         Description = package.Description,
         Listed = package.Listed,
         ReleaseNotes = package.ReleaseNotes,
         Title = package.Title
     });
 }
 public static ODataPackage AsODataPackage(this INuGetPackage package, ClientCompatibility compatibility)
 {
     return(new ODataPackage
     {
         Id = package.Id,
         Version = package.Version.ToOriginalString(),
         NormalizedVersion = package.Version.ToNormalizedString(),
         IsPrerelease = !string.IsNullOrWhiteSpace(package.Version.SpecialVersion),
         Title = package.Title,
         Authors = string.Join(",", package.Authors),
         Owners = string.Join(",", package.Owners),
         IconUrl = package.IconUrl == null ? null : package.IconUrl.GetComponents(UriComponents.HttpRequestUrl, UriFormat.Unescaped),
         LicenseUrl = package.LicenseUrl == null ? null : package.LicenseUrl.GetComponents(UriComponents.HttpRequestUrl, UriFormat.Unescaped),
         ProjectUrl = package.ProjectUrl == null ? null : package.ProjectUrl.GetComponents(UriComponents.HttpRequestUrl, UriFormat.Unescaped),
         DownloadCount = package.DownloadCount,
         RequireLicenseAcceptance = package.RequireLicenseAcceptance,
         DevelopmentDependency = package.DevelopmentDependency,
         Description = package.Description,
         Summary = package.Summary,
         ReleaseNotes = package.ReleaseNotes,
         Published = package.Created.UtcDateTime,
         LastUpdated = package.LastUpdated.UtcDateTime,
         Dependencies = string.Join("|", package.DependencySets.SelectMany(ConvertDependencySetToStrings)),
         PackageHash = package.PackageHash,
         PackageHashAlgorithm = package.PackageHashAlgorithm,
         PackageSize = package.PackageSize,
         Copyright = package.Copyright,
         Tags = package.Tags,
         IsAbsoluteLatestVersion = package.IsLatestVersion,
         IsLatestVersion = package.IsLatestVersion,
         Listed = package.Listed,
         VersionDownloadCount = package.DownloadCount,
         MinClientVersion = package.MinClientVersion == null ? null : package.MinClientVersion.ToString(),
         Language = package.Language
     });
 }
 public NuGetReference(INuGetPackage package, AssemblyName assemblyName, bool isPrivate, string hintPath, string projectDirectory)
     : base(assemblyName, projectDirectory, hintPath)
 {
     Package   = package;
     IsPrivate = isPrivate;
 }