public IHttpActionResult Delete(int id) { if (projectDal.IsExistById(id)) { Project project = projectDal.GetProject(id); if (project.WorkerId == null || (project.IsCompletedOwner && project.IsCompletedWorker)) { projectDal.DeleteProject(id); return(Ok("Deleted.")); } else { return(BadRequest("This operation is denied.")); } } else { return(NotFound()); } }