Exemplo n.º 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());
            }
        }
Exemplo n.º 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());
            }
        }
Exemplo n.º 3
0
 public TableParser(ClubCommand clubCommand)
 {
     _clubCommand = clubCommand;
 }
Exemplo n.º 4
0
 public EventService(WebReader webReader, ClubCommand clubCommand)
 {
     _webReader   = webReader;
     _clubCommand = clubCommand;
 }
Exemplo n.º 5
0
 public TableReader(WebReader webReader, ClubCommand clubCommand)
 {
     _webReader   = webReader;
     _clubCommand = clubCommand;
 }