I have a type named CodeText for some special properties and I create
a type named CodeTextUserType implemented IUserType to support my type
for hibernate, and my mapping file like this:
<property name="Gender" type="xxx.xxx.CodeTextUserType" />

Everything does well except using  Expression:
cri.Add(Expression.Eq("Gender", new CodeText("01")));
I got an exception "Type mismatch in
NHibernate.Criterion.SimpleExpression: Gender expected type
xxx.xxx..CodeTextType, actual type xxx.CodeText"

I can not want to change code new CodeText("01") to code new
CodeTextUserType("01") because it looks so strange and
CodeTextUserType don't have that constructor.

I know that I can make CodeText to implement IUserType instead of
CodeTextUserType to resolve this problem, but I just do not want my
type to depend on NHibernate. If I do so, my domains project must have
the reference to Nhibernate.
so, want shall i do?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to