public ActionResult ChangeStatus(int id)
        {
            Task task = _repository.GetTaskById(id);

            _repository.ChangeStatus(task);

            return(RedirectToAction("Index"));
        }
        public IHttpActionResult ChangeStatus(TaskViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                Task task = Mapper.Map <Task>(viewModel);

                _repository.ChangeStatus(task);
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }