开发者

sharp architecture question, nhibernate validation

开发者 https://www.devze.com 2022-12-24 13:55 出处:网络
I have marked certain properties in my domain object for the nhibernate validation \'framework\'. If I do this in my controller explicitly:

I have marked certain properties in my domain object for the nhibernate validation 'framework'.

If I do this in my controller explicitly:

ICollection<IVa开发者_C百科lidationResult> test =  bla.ValidationResults();

I get the validation errors which I could add to my asp.net mvc modelstate

ideally, i would like an exception being thrown during:

bla = blaRepository.SaveOrUpdate(bla);

if i try to save or update the domain object. why is this not happening? my domain object bla derives from Entity.

do I have to register something somehow?

Thanks.

christian


Please see if this blog entry I wrote applies in your situation. It's hard to tell from your description.

Using NHibernate Validator Event Based Validation

0

精彩评论

暂无评论...
验证码 换一张
取 消