C# Class NuGet.PackageReferenceRepository

This repository implementation keeps track of packages that are referenced in a project but it also has a reference to the repository that actually contains the packages. It keeps track of packages in an xml file at the project root (packages.xml).
Inheritance: IPackageReferenceRepository, IPackageLookup, IPackageConstraintProvider, ILatestPackageLookup
Show file Open project: themotleyfool/NuGet Class Usage Examples

Private Properties

Property Type Description
GetPackageReference PackageReference
GetPackagesCore IEnumerable

Public Methods

Method Description
AddPackage ( IPackage package ) : void
AddPackage ( string packageId, SemanticVersion version, FrameworkName targetFramework ) : void
Exists ( string packageId, SemanticVersion version ) : bool
FindPackage ( string packageId, SemanticVersion version ) : IPackage
GetConstraint ( string packageId ) : IVersionSpec
GetPackageTargetFramework ( string packageId ) : FrameworkName
GetPackages ( ) : IQueryable
PackageReferenceRepository ( IFileSystem fileSystem, ISharedPackageRepository sourceRepository ) : System
RegisterIfNecessary ( ) : void
RemovePackage ( IPackage package ) : void
TryFindLatestPackageById ( string id, SemanticVersion &latestVersion ) : bool

Private Methods

Method Description
GetPackageReference ( string packageId ) : PackageReference
GetPackagesCore ( ) : IEnumerable

Method Details

AddPackage() public method

public AddPackage ( IPackage package ) : void
package IPackage
return void

AddPackage() public method

public AddPackage ( string packageId, SemanticVersion version, FrameworkName targetFramework ) : void
packageId string
version SemanticVersion
targetFramework FrameworkName
return void

Exists() public method

public Exists ( string packageId, SemanticVersion version ) : bool
packageId string
version SemanticVersion
return bool

FindPackage() public method

public FindPackage ( string packageId, SemanticVersion version ) : IPackage
packageId string
version SemanticVersion
return IPackage

GetConstraint() public method

public GetConstraint ( string packageId ) : IVersionSpec
packageId string
return IVersionSpec

GetPackageTargetFramework() public method

public GetPackageTargetFramework ( string packageId ) : FrameworkName
packageId string
return FrameworkName

GetPackages() public method

public GetPackages ( ) : IQueryable
return IQueryable

PackageReferenceRepository() public method

public PackageReferenceRepository ( IFileSystem fileSystem, ISharedPackageRepository sourceRepository ) : System
fileSystem IFileSystem
sourceRepository ISharedPackageRepository
return System

RegisterIfNecessary() public method

public RegisterIfNecessary ( ) : void
return void

RemovePackage() public method

public RemovePackage ( IPackage package ) : void
package IPackage
return void

TryFindLatestPackageById() public method

public TryFindLatestPackageById ( string id, SemanticVersion &latestVersion ) : bool
id string
latestVersion SemanticVersion
return bool