Пример #1
0
        public ActionResult Put(Project project)
        {
            var temp = _dao.GetById(project.Id);

            if (temp == null)
            {
                return(BadRequest(new { message = $"Project {project.Id} not found!" }));
            }
            if (ModelState.IsValid)
            {
                _dao.Update(project, project.Id);
                _dao.Save();
                return(Ok(new ProjectResponse(temp, $"Project {project.Name} changed!")));
            }
            return(ValidationProblem());
        }