コード例 #1
0
        public async Task Delete(Guid id)
        {
            NaturalPerson person = await _naturalPersonRepository.GetById(id);

            _naturalPersonRepository.Delete(person);
            _addressRepository.Delete(person.Address);
            _documentRepository.Delete(person.Document);

            await _unitOfWork.Commit();
        }
コード例 #2
0
        public async Task DeleteAsync(int id)
        {
            var person = await _personRepository.GetAsync(id);

            if (person == null)
            {
                return;
            }

            _personRepository.Delete(person);

            _personRepository.SaveChanges();
        }