Beispiel #1
0
        public ActionResult AddressUpdate(int id, AddressUpdateDto addressUpdate)
        {
            var addressUpdateRepo = _addrRepo.GetAddressById(id);

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

            _addrMapper.Map(addressUpdate, addressUpdateRepo);
            _addrRepo.UpdateAddress(addressUpdateRepo);
            _addrRepo.SaveChanges();
            return(NoContent());
        }
        public ActionResult UpdateAddress(int Id, AddressUpdateDto addressUpdateDto)
        {
            var address = _repository.GetAddressById(Id);

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

            _mapper.Map(addressUpdateDto, address);

            _repository.UpdateAddress(address);

            _repository.SaveChanges();

            return(NoContent());
        }