예제 #1
0
        internal Tasky Edit(Tasky editTask)
        {
            var data = GetById(editTask.Id);

            editTask.Body = editTask.Body != null ? editTask.Body : data.Body;
            return(_repo.Edit(editTask));
        }
예제 #2
0
        internal Task Edit(int id, Task editTask)
        {
            Task found = GetOne(id);

            editTask.id = id;
            return(_repo.Edit(editTask));
        }
예제 #3
0
        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));
        }