public async Task UpdateParent(int id, ParentUpdateDTO parentUpdateDTO) { var currentParent = await GetByIdAsync(id); Update(currentParent); currentParent.Name = parentUpdateDTO.Name; currentParent.Surname = parentUpdateDTO.Surname; currentParent.ModifiedDate = DateTime.Now; }
public Task <int> UpdateParent(int id, ParentUpdateDTO parentUpdateDTO) { _unitOfWork.Parents.UpdateParent(id, parentUpdateDTO); return(_unitOfWork.SaveAsync()); }
public async Task <ActionResult <string> > UpdateParent(int id, [FromBody] ParentUpdateDTO parentUpdateDTO) { var result = await _parentService.UpdateParent(id, parentUpdateDTO); return(result > 0 ? StatusCode(StatusCodes.Status200OK) : BadRequest()); }