Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class referencing itself
Message
 
 
À
14/03/2018 03:22:38
Information générale
Forum:
C#
Catégorie:
Conception classe
Divers
Thread ID:
01658720
Message ID:
01658738
Vues:
31
>Nothing wrong, in principle, with a class containing a list of it's own instances but if, as you discovered, if it recursively passes an instance that has already been processed you will end up in an infinite loop.
>Either, as you mentioned, limit the recursion count or, maybe better depending on the expected structure, check that an item has not already been processed.

I'm thinking that something is wrong with my local data because I'm not reproducing this error in two other test environments or with other rows. May be I should just delete this bad instance for now and watch out if I can reproduce in a future.

UPDATE. Found I had two root elements (not sure how that happened). I deleted the bad row and will be testing it now.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform