예제 #1
0
 public IHttpActionResult Put(Club alumno)
 {
     try
     {
         ClubBLL.Update(alumno);
         return(Content(HttpStatusCode.OK, "Club actualizado correctamente"));
     }
     catch (Exception ex) {
         return(BadRequest(ex.Message));
     }
 }
예제 #2
0
        public void update()
        {
            ClubBLL bll   = new ClubBLL();
            var     model = new Model.club();

            model.id   = 2;
            model.name = "123321";
            model.logo = "123321";
            bll.Update(model, new[] { "id", "name", "logo" });
            JsonSerializer serializer = new JsonSerializer();

            Console.WriteLine(JsonConvert.SerializeObject(model));
        }
예제 #3
0
        public async Task <IHttpActionResult> PutClub(int id, Club club)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != club.id_club)
            {
                return(BadRequest());
            }

            ClubBLL.Update(club);

            return(StatusCode(HttpStatusCode.NoContent));
        }