using Microsoft.Extensions.Configuration; namespace IPMonitor { public class Executor { private readonly IConfiguration _configuration; private readonly IMainService _mainService; private readonly IArguments _arguments; public Executor(IMainService mainService,IConfigurationRoot configuration,IArguments arguments) { _configuration = configuration ?? throw new ArgumentException(nameof(configuration)); _mainService = mainService ?? throw new ArgumentException(nameof(mainService)); _arguments = arguments ?? throw new ArgumentException(nameof(arguments)); } /// /// This is essentially the starting point where we bootstrap the legacy entry point /// public void Execute() { _mainService.RunService(_arguments.GetArguments(), _configuration); } } }