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)); }
internal Task GetOne(int id) { Task found = _repo.GetOne(id); if (found == null) { throw new Exception("BAD ID."); } return(found); }