Exemple #1
0
        public async Task <ActionResult <Club> > PostNewClub(ClubCommand command)
        {
            try
            {
                var newClub = _mapper.Map <Club>(command);
                await _repository.PostNewClub(newClub);

                _logger.LogInformation($"Club has been added.");
                return(Ok());
            }
            catch (System.Exception ext)
            {
                _logger.LogError(ext, "Club hasn't been added.");
                // TODO return error object with proper error code.
                return(BadRequest());
            }
        }
Exemple #2
0
        public async Task <ActionResult <Club> > PutExistingClub(string clubName, ClubCommand command)
        {
            try
            {
                var updatedClub = _mapper.Map <Club>(command);
                await _repository.PutExistingClub(clubName, updatedClub);

                _logger.LogInformation($"Club has been updated.");
                return(Ok());
            }
            catch (System.Exception ext)
            {
                _logger.LogError(ext, "Club hasn't been updated.");
                // TODO return error object with proper error code.
                return(BadRequest());
            }
        }
Exemple #3
0
 public TableParser(ClubCommand clubCommand)
 {
     _clubCommand = clubCommand;
 }
Exemple #4
0
 public EventService(WebReader webReader, ClubCommand clubCommand)
 {
     _webReader   = webReader;
     _clubCommand = clubCommand;
 }
Exemple #5
0
 public TableReader(WebReader webReader, ClubCommand clubCommand)
 {
     _webReader   = webReader;
     _clubCommand = clubCommand;
 }