Ejemplo n.º 1
0
        public ActionResult UpdatePhone(int Id, PhoneUpdateDto phoneUpdateDto)
        {
            var phone = _repository.GetPhoneById(Id);

            if (phone == null)
            {
                return(NotFound());
            }

            _mapper.Map(phoneUpdateDto, phone);

            _repository.UpdatePhone(phone);

            _repository.SaveChanges();

            return(NoContent());
        }