示例#1
0
        public async Task <IActionResult> EditWork(int userId, int id,
                                                   [FromBody] WorkDTO workForEdit)
        {
            if (userId != int.Parse(User.FindFirst(ClaimTypes.NameIdentifier).Value))
            {
                return(Unauthorized());
            }

            _repo.EditWork(id, workForEdit);
            await _repo.SaveAll();

            return(Ok());
        }
示例#2
0
 public IActionResult ApplayEdit(Work workDto)
 {
     workRepository.EditWork(workDto);
     return(RedirectToAction("ShowTaskWorks", new { @taskId = _taskId }));
 }
示例#3
0
 public IActionResult Edit(EditWorkDto editWorkDto)
 {
     workRepository.EditWork(editWorkDto);
     return(Redirect("GetAllWorks"));
 }