Skip to content

Commit

Permalink
(chocolateyGH-357) Change modifier for method
Browse files Browse the repository at this point in the history
So that the method to get_all_installed_packages can be consumed from
elsewhere in the codebase.  This meant extending the interface for
INugetService to include this method as well, otherwise, a concrete
reference to an instance of NuGetService would be required, which is not
available.
  • Loading branch information
gep13 committed May 5, 2021
1 parent aa4779d commit 8e9cb8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/chocolatey/infrastructure.app/services/INugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
namespace chocolatey.infrastructure.app.services
{
using System.Collections.Concurrent;
using System.Collections.Generic;
using configuration;
using results;

Expand Down Expand Up @@ -58,5 +59,11 @@ public interface INugetService : ISourceRunner
/// <param name="packageName">Name of the package.</param>
void remove_rollback_directory_if_exists(string packageName);


/// <summary>
/// Get all installed packages
/// </summary>
/// <param name="config">The configuration</param>
IEnumerable<PackageResult> get_all_installed_packages(ChocolateyConfiguration config);
}
}
2 changes: 1 addition & 1 deletion src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ public virtual void remove_installation_files(IPackage removedPackage, Chocolate
}
}

private IEnumerable<PackageResult> get_all_installed_packages(ChocolateyConfiguration config)
public IEnumerable<PackageResult> get_all_installed_packages(ChocolateyConfiguration config)
{
//todo : move to deep copy for get all installed
//var listConfig = config.deep_copy();
Expand Down

0 comments on commit 8e9cb8a

Please sign in to comment.