public IActionResult Add([FromBody] EventRegistration evntReg)
 {
     if (ModelState.IsValid)
     {
         _eventRegRepo.Add(evntReg);
         return(CreatedAtRoute("GetEventRegistration", new { Controller = "EventRegistration", id = evntReg.RegistrationID }, evntReg));
     }
     else
     {
         return(BadRequest());
     }
 }
Пример #2
0
 public IActionResult Add([FromBody] Club club)
 {
     if (ModelState.IsValid)
     {
         _clubRepo.Add(club);
         return(CreatedAtRoute("GetClub", new { Controller = "Club", id = club.ClubID }, club));
     }
     else
     {
         return(BadRequest());
     }
 }
Пример #3
0
 public IActionResult Add([FromBody] User user)
 {
     if (ModelState.IsValid)
     {
         _userRepo.Add(user);
         return(CreatedAtRoute("GetUser", new { Controller = "User", id = user.UserID }, user));
     }
     else
     {
         return(BadRequest());
     }
 }
Пример #4
0
 public IActionResult Add([FromBody] Athlete athlete)
 {
     if (ModelState.IsValid)
     {
         _athleteRepo.Add(athlete);
         return(CreatedAtRoute("GetAthlete", new { Controller = "Athlete", id = athlete.AthleteID, athlete }));
     }
     else
     {
         return(BadRequest());
     }
 }
Пример #5
0
 public IActionResult Add([FromBody] Club_Athlete member)
 {
     if (ModelState.IsValid)
     {
         _clubMemberRepo.Add(member);
         return(CreatedAtRoute("GetMember", new { Controller = "ClubMember", id = member.MemberID }, member));
     }
     else
     {
         return(BadRequest());
     }
 }