public IHttpActionResult PutTaskModel(int id, TaskModel taskModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TaskModelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
 public ActionResult Edit([Bind(Include = "Id,Title,Content,CreatedAt")] TaskModel taskModel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(taskModel).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(taskModel));
 }