public async Task <IActionResult> Edit(Guid id) { var collaboratorViewModel = _mapper.Map <CollaboratorViewModel>(await _collaboratorRepository.GetCollaboratorPhonesAddressesContacts(id)); if (collaboratorViewModel == null) { return(NotFound()); } collaboratorViewModel = await FillCollaborator(collaboratorViewModel); return(View(collaboratorViewModel)); }
public async Task Remove(Guid id) { var collaborator = _collaboratorRepository.GetCollaboratorPhonesAddressesContacts(id); foreach (var phone in collaborator.Result.Phones) { await _phoneService.Remove(phone.Id); } foreach (var address in collaborator.Result.Addresses) { await _addressService.Remove(address.Id); } await _collaboratorRepository.Remove(id); }