jeudi 25 août 2016

Practice to ensure ViewModel state doesn't change after validation

If Controller first validates ViewModel properties and then uses ViewModel properties, there may be small chance that ViewModel state may change to invalid between validation and usage, resulting in exceptional control flow.

Is there any common practice or pattern to ensure ViewModel state doesn't change and / or properties can be safely used after validation?

Aucun commentaire:

Enregistrer un commentaire