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()); } }
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()); } }
public TableParser(ClubCommand clubCommand) { _clubCommand = clubCommand; }
public EventService(WebReader webReader, ClubCommand clubCommand) { _webReader = webReader; _clubCommand = clubCommand; }
public TableReader(WebReader webReader, ClubCommand clubCommand) { _webReader = webReader; _clubCommand = clubCommand; }