Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validate A Class
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Validate A Class
Divers
Thread ID:
01458686
Message ID:
01458686
Vues:
129
What's the best way to validate that all required properties on a class are completed correctly? The properties will eventually be
mapped to UI fields, but the class itself is not visual. It's possible to instantiate the class, set some or all properties, and then call
methods on it. I want to ensure that all required properties are complete before certain methods are run.

The question is what to do if a required property is not set or is set wrong. Throw an exception?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform