Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using enum as a parameter
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00971423
Message ID:
00971498
Vues:
14
Stephane,
Correct you are, but, like Cetin said, I can cast a value to the enum and it still works even if that value casted is not contained in the enum.

This works:
test.Class1.myMethod((test.Class1.myEnum) 1);

but this doesn't
test.Class1.myMethod(1);

So it appears that I still have to validate the parameter passed. Shoot I was hoping that I didn't have to validate by passing an enum.

Einar


>I guess it will work with 0, probably because 0 is the default value for all enum types. But it will not work with any other value.
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform