Another NHibernate Contribution project, NHibernate Validator, provides data validation for classes. In this recipe, I'll show you how to use NHibernate Validator attributes to validate your entities.
nhv-mapping.xsdfrom the downloaded ZIP file to your solution's
xsdfiles to the
Schemafolder of your solution, just as we did with the NHibernate xml schema files in the Mapping a class with XML recipe in Chapter 1.
Eg.Coremodel and mappings from Chapter 1.