Esempio n. 1
0
 public IActionResult CreateLink(SportsTournament sportsTournament)
 {
     try
     {
         if (sportsTournament != null)
         {
             _logger.LogInformation("Record successfully added");
             _sportTournamentService.Add(sportsTournament);
             return(Ok("Record successfully added"));
         }
         else
         {
             return(BadRequest("There was an error trying to process your request"));
         }
     }
     catch (Exception ex)
     {
         _logger.LogError($"Link Operation failed ", ex);
         return(BadRequest($"There was an error trying to process your request {ex}"));
     }
 }
Esempio n. 2
0
 public IActionResult Update(int?sportTournamentId, SportsTournament sportsTournament)
 {
     try
     {
         if (sportTournamentId.HasValue && sportTournamentId == sportsTournament.SportTourtnamentId)
         {
             _logger.LogInformation("Record successfully updated");
             _sportTournamentService.Update(sportsTournament);
             return(Ok("Record successfully updated"));
         }
         else
         {
             return(NotFound("Record was not found"));
         }
     }
     catch (Exception ex)
     {
         _logger.LogError("Update operation failed ", ex);
         return(BadRequest($"There was an error processing your request {ex}"));
     }
 }
Esempio n. 3
0
 public void Update(SportsTournament sportsTournament)
 {
     _context.Entry(sportsTournament).State = EntityState.Modified;
     _context.SaveChanges();
 }
Esempio n. 4
0
 public void Add(SportsTournament sportsTournament)
 {
     _context.SportsTournament.Add(sportsTournament);
     _context.SaveChanges();
 }
 public void Update(SportsTournament sportsTournament)
 {
     _sportTournamentRepository.Update(sportsTournament);
 }
 public void Add(SportsTournament sportsTournament)
 {
     _sportTournamentRepository.Add(sportsTournament);
 }