public async Task <Destinatario> UpdateDestinatarioAsync(string userId, int id, Destinatario destinatario) { if (id != destinatario.Id) { throw new NotFoundItemException($"not found destination with id:{id}"); } await validateUserId(userId); destinatario.UsuarioId = userId; var destEntity = mapper.Map <DestinatarioEntity>(destinatario); ARBRepository.UpdateDestinatarioAsync(destEntity); if (await ARBRepository.SaveChangesAsync()) { return(mapper.Map <Destinatario>(destEntity)); } throw new Exception("there were an error with the BD"); }