public PlayersController(
     IPlayersRepository playersRepository,
     IGeoLocationClient geoLocationClient,
     IAdminActionsRepository adminActionsRepository,
     IPlayerAnalyticsRepository playerAnalyticsRepository)
 {
     _playersRepository         = playersRepository ?? throw new ArgumentNullException(nameof(playersRepository));
     _geoLocationClient         = geoLocationClient ?? throw new ArgumentNullException(nameof(geoLocationClient));
     _adminActionsRepository    = adminActionsRepository ?? throw new ArgumentNullException(nameof(adminActionsRepository));
     _playerAnalyticsRepository = playerAnalyticsRepository ?? throw new ArgumentNullException(nameof(playerAnalyticsRepository));
 }
Example #2
0
 public HomeController(ILogger <HomeController> logger,
                       IGeoLocationClient geoLocationClient,
                       IHttpContextAccessor httpContext,
                       IAddressValidator addressValidator,
                       IWebHostEnvironment environment)
 {
     _logger            = logger ?? throw new ArgumentNullException(nameof(logger));
     _geoLocationClient = geoLocationClient ?? throw new ArgumentNullException(nameof(geoLocationClient));
     _httpContext       = httpContext ?? throw new ArgumentNullException(nameof(httpContext));
     _addressValidator  = addressValidator ?? throw new ArgumentNullException(nameof(addressValidator));
     _environment       = environment ?? throw new ArgumentNullException(nameof(environment));
 }
        public GameServerStatusRepository(IGameServerStatusRepositoryOptions options,
                                          IGameServersRepository gameServersRepository,
                                          IGameServerClientFactory gameServerClientFactory,
                                          IGeoLocationClient geoLocationClient,
                                          IPlayerLocationsRepository playersLocationsRepository)
        {
            _gameServersRepository      = gameServersRepository ?? throw new ArgumentNullException(nameof(gameServersRepository));
            _gameServerClientFactory    = gameServerClientFactory ?? throw new ArgumentNullException(nameof(gameServerClientFactory));
            _geoLocationClient          = geoLocationClient ?? throw new ArgumentNullException(nameof(geoLocationClient));
            _playersLocationsRepository = playersLocationsRepository ?? throw new ArgumentNullException(nameof(playersLocationsRepository));
            var storageAccount   = CloudStorageAccount.Parse(options.StorageConnectionString);
            var cloudTableClient = storageAccount.CreateCloudTableClient();

            _statusTable = cloudTableClient.GetTableReference(options.StorageTableName);
            _statusTable.CreateIfNotExistsAsync().Wait();
        }
 public TaxCalculator(IGeoLocationClient locationClient)
 {
     _locationClient = locationClient;
 }