public async Task <IHttpActionResult> PutCard(int id, Card card) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != card.CardId) { return(BadRequest()); } db.Entry(card).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CardExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task EditAsync(Board board) { using (var db = new TrelloModelDBContainer()) { db.Entry(board).State = EntityState.Modified; await db.SaveChangesAsync(); } }
public void Edit(Board board) { using (var db = new TrelloModelDBContainer()) { db.Entry(board).State = EntityState.Modified; db.SaveChanges(); } }