views:

12

answers:

1

I am rather stumped on this.

Fluent Nhibernate v1.1.0.685 NHibernate v2.1.2.4000

When I check the ModelState.IsValid prop before calling the Save() on the Repository. The IsValid prop is always False. When debugging the Id value is "" (empty) in the Model. I have overridden the Mappings for the Id :: mapping.Id(x => x.Id).GeneratedBy.Identity();

If the Save() or Inset() method is called w/o checking checking modelstate the item is saved in the DB.

Any thoughts or suggestions would be appreciated.

A: 

I was using the DataAnnotations from within NHibernate.Validator with not realizing that would also need to be registered before the Session object was created.

I have since simply decided to user the MVC DataAnnotations within the ComponentModel namespace.

Simple enough.

dave

related questions