Exemple #1
0
        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));
        }
Exemple #2
0
 public async Task EditAsync(Board board)
 {
     using (var db = new TrelloModelDBContainer())
     {
         db.Entry(board).State = EntityState.Modified;
         await db.SaveChangesAsync();
     }
 }
Exemple #3
0
 public void Edit(Board board)
 {
     using (var db = new TrelloModelDBContainer())
     {
         db.Entry(board).State = EntityState.Modified;
         db.SaveChanges();
     }
 }