Beispiel #1
0
 public IHttpActionResult Post(Club alumno)
 {
     try
     {
         ClubBLL.Create(alumno);
         return(Content(HttpStatusCode.Created, "Club creado correctamente"));
     }
     catch (Exception ex) {
         return(BadRequest(ex.Message));
     }
 }
Beispiel #2
0
        public async Task <IHttpActionResult> PostClub(Club club)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            ClubBLL.Create(club);

            return(CreatedAtRoute("DefaultApi", new { id = club.id_club }, club));
        }