public IHttpActionResult Put(Club alumno) { try { ClubBLL.Update(alumno); return(Content(HttpStatusCode.OK, "Club actualizado correctamente")); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
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)); }
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)); }