I have a class containing Linq To SQL objects that are used to populate drop downlists on a view. Using Scott Gu's Nerd Dinner I am implementing the validation framework they use, using partial classes. This works fine when working with one object for (example dinner) per view. But when I use a class that is not a Linq To Sql object, I cannot get the validation working. Any ideas?
+1
A:
The Nerd Dinner app leverages the events that are fired when Linq To SQL persists data. Specifically, the OnValidate() method.
Since you have a class that is not Linq To Sql, you can fake it by creating your own custom event handler and firing it when the data in the changes.
As an alternative, just call a method that validates a given object, calling as many validation functions as you have objects.
AndrewDotHay
2009-05-24 04:19:06