NuGetReference
Represents a NuGet package reference with package identifier and version.
Inherits: BaseCodeReference
Constructors
public NuGetReference()
nuGetReference = NuGetReference()
Initializes a new instance of the NuGetReference.
public NuGetReference(IFileSystem fileSystem)
nuGetReference = NuGetReference(fileSystem)
Initializes a new instance of the NuGetReference with a custom file system.
Properties
public override bool IsValid { get; }
value = nuGetReference.IsValid
Gets a value indicating whether the NuGet package reference is valid.
public override string Location { get; }
value = nuGetReference.Location
Gets the location of the NuGet package reference (empty for NuGet packages).
public override string Name { get; }
value = nuGetReference.Name
Gets the display name of the NuGet package reference.
public string PackageId { get; set; }
value = nuGetReference.PackageId
nuGetReference.PackageId = value
Gets or sets the NuGet package identifier.
public string Version { get; set; }
value = nuGetReference.Version
nuGetReference.Version = value
Gets or sets the version of the NuGet package.
Methods
public override ValueTask<IEnumerable<ValueTuple<string, byte[]>>> GetImages(CancellationToken cancellationToken)
result = nuGetReference.GetImages(cancellationToken)
Asynchronously retrieves the images associated with the code reference.
- cancellationToken
- The token to monitor for cancellation requests.
Returns: A task that represents the asynchronous operation. The task result contains an enumerable of tuples with image name and image body.
public override Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = nuGetReference.LoadAsync(storage, cancellationToken)
Loads the settings from the specified storage.
- storage
- The storage containing the settings.
- cancellationToken
- CancellationToken
Returns: Task
public override Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = nuGetReference.SaveAsync(storage, cancellationToken)
Saves the settings to the specified storage.
- storage
- The storage where the settings will be saved.
- cancellationToken
- CancellationToken
Returns: Task