internal Tasky Edit(Tasky editTask) { var data = GetById(editTask.Id); editTask.Body = editTask.Body != null ? editTask.Body : data.Body; return(_repo.Edit(editTask)); }
internal Task Edit(int id, Task editTask) { Task found = GetOne(id); editTask.id = id; return(_repo.Edit(editTask)); }
internal MyTask Edit(MyTask editData, string userId) { MyTask original = _repo.GetOne(editData.Id); if (original == null) { throw new Exception("Bad Id"); } if (original.CreatorId != userId) { throw new Exception("Not your task : Access Denied"); } _repo.Edit(editData); return(_repo.GetOne(editData.Id)); }