Exemple #1
0
        public async Task <IHttpActionResult> PutPageNodes(int id, PageNodes pageNodes)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != pageNodes.Id)
            {
                return(BadRequest());
            }

            db.Entry(pageNodes).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PageNodesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }