public void DeleteUser(UserDO user) { _projectStaffDao.DeleteAllStaffingForUser(user.UserId); var usersTasks = _taskDao.ReadAllUserTasks(user.UserId); foreach (var task in usersTasks) { task.UserId = null; task.User = null; _taskDao.Update(task); } _userDao.Delete(user); }