public IActionResult Update([FromBody] EventRegistration evntReg) { if (ModelState.IsValid) { EventRegistration eventReg = _eventRegRepo.Get(evntReg.RegistrationID); if (eventReg == null) { return(NotFound()); } _eventRegRepo.Update(evntReg); return(new NoContentResult()); } else { return(BadRequest()); } }
public IActionResult Update([FromBody] Event evnt) { if (ModelState.IsValid) { Event existingEvent = _eventRepo.Get(evnt.EventID); if (existingEvent == null) { return(NotFound()); } _eventRepo.Update(evnt); return(new NoContentResult()); } else { return(BadRequest()); } }
public IActionResult Update([FromBody] Club club) { if (ModelState.IsValid) { Club existingClub = _clubRepo.Get(club.ClubID); if (existingClub == null) { return(NotFound()); } _clubRepo.Update(club); return(new NoContentResult()); } else { return(BadRequest()); } }
public IActionResult Update([FromBody] Athlete athlete) { if (ModelState.IsValid) { Athlete existingAthlete = _athleteRepo.Get(athlete.AthleteID); if (existingAthlete == null) { return(NotFound()); } _athleteRepo.Update(athlete); return(new NoContentResult()); } else { return(BadRequest()); } }
public IActionResult Update([FromBody] User user) { if (ModelState.IsValid) { User existingUser = _userRepo.Get(user.UserID); if (existingUser == null) { return(NotFound()); } _userRepo.Update(user); return(new NoContentResult()); } else { return(BadRequest()); } }
public IActionResult Update([FromBody] Club_Athlete member) { if (ModelState.IsValid) { Club_Athlete existingMember = _clubMemberRepo.Get(member.MemberID); if (existingMember == null) { return(NotFound()); } _clubMemberRepo.Update(member); return(new NoContentResult()); } else { return(BadRequest()); } }