开发者

PersistenceSpecification and Enums

开发者 https://www.devze.com 2022-12-09 05:31 出处:网络
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();

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

精彩评论

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