Example #1
0
        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;
        }
Example #2
0
 public Task <int> UpdateParent(int id, ParentUpdateDTO parentUpdateDTO)
 {
     _unitOfWork.Parents.UpdateParent(id, parentUpdateDTO);
     return(_unitOfWork.SaveAsync());
 }
Example #3
0
        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());
        }