NuGet.PackageReferenceFile.DeleteEntry C# (CSharp) Method

DeleteEntry() public method

Deletes an entry from the file with matching id and version. Returns true if the file was deleted.
public DeleteEntry ( string id, SemanticVersion version ) : bool
id string
version SemanticVersion
return bool
        public bool DeleteEntry(string id, SemanticVersion version)
        {
            XDocument document = GetDocument();

            if (document == null)
            {
                return false;
            }

            return DeleteEntry(document, id, version);
        }

Same methods

PackageReferenceFile::DeleteEntry ( System.Xml.Linq.XDocument document, string id, SemanticVersion version ) : bool

Usage Example

Example #1
0
 public void RemovePackage(IPackage package)
 {
     if (_packageReferenceFile.DeleteEntry(package.Id, package.Version))
     {
         // Remove the repository from the source
         SourceRepository.UnregisterRepository(_packageReferenceFile);
     }
 }
All Usage Examples Of NuGet.PackageReferenceFile::DeleteEntry