开发者

PersistenceSpecification and Enums

How does one test enum type properties with PersistenceSpecification. I have it mapped like this

 Map(x => x.AccountStatus).Column("Status").CustomSqlType("int").Not.Nullable();

and I check it like this

 spec.CheckProperty(o => o.AccountStatus, UserStatus.Disabled)

but it fails with this message

NHibernate.HibernateException: Can't Parse 0 as UserStatus

It does not look like it is Fluent's error message, b开发者_JAVA百科ut just saving it using Session works fine.

Any ideas?


Taking of .CustomSqlType("int") solves the problem

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜