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 Create([Bind(Include = "Id,Title,Content")] TaskModel taskModel)
        {
            if (ModelState.IsValid)
            {
                taskModel.CreatedAt = DateTime.UtcNow;

                db.TaskModels.Add(taskModel);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(taskModel));
        }