public AuthController( AuthKeyValidator authKeyValidator, IMapper mapper, ILogger <AuthController> logger) { _authKeyValidator = authKeyValidator ?? throw new ArgumentNullException(nameof(authKeyValidator)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
static async Task Main(string[] args) { // Poor man DI IKeyRepository keyRepository = new InMemoryKeyRepository(); IApplicationRepository appRepo = new InMemoryApplicationRepository(); var httpClient = new System.Net.Http.HttpClient(); httpClient.BaseAddress = new Uri("http://localhost:51313"); var apiClient = new KeyCheckerApiClient(httpClient); var authKeyValidator = new AuthKeyValidator(keyRepository, appRepo, null); var program = new Program(authKeyValidator, apiClient); // Собственно выполнение самой проги await program.ExecuteTestSequenceAsync(); Console.ReadLine(); }
public Program(AuthKeyValidator authKeyValidator, KeyCheckerApiClient keyCheckerApiClient) { _keyValidator = authKeyValidator; _keyCheckerApiClient = keyCheckerApiClient; }