The fallowing was working with NHibernate 2.1. Now with NHibernate 3 it doesn't. I have a Table with Column Kind, which has the fallowing Mapping:
Now, when I try do with Linq
.Where(x => x.Kind == (byte)criteria.Value)
where criteria.Value is a byte-Value, I get a InvalidCastException:(could not execute query [ select ... from ProjectType projecttyp0_ where projecttyp0_.Kind=? order by projecttyp0_.Name asc ] Name:p1 - Value:0 ) --->
bei NHibernate.Type.ByteType.Set(IDbCommand cmd, Object value, Int32 index) in d:\CSharp\NH\nhibernate\src\NHibernate\Type\ByteType.cs:Zeile 44. bei NHibernate.Type.NullableType.NullSafeSet(IDbCommand cmd, Object value, Int32 index) in d:\CSharp\NH\nhibernate\src\NHibernate\Type\NullableType.cs:Zeile 180. bei NHibernate.Type.NullableType.NullSafeSet(IDbCommand st, Object value, Int32 index, ISessionImplementor session) in d:\CSharp\NH\nhibernate\src\NHibernate\Type\NullableType.cs:Zeile 139. bei NHibernate.Engine.QueryParameters.BindParameters(IDbCommand command, Int32 start, ISessionImplementor session) in d:\CSharp\NH\nhibernate\src\NHibernate\Engine\QueryParameters.cs:Zeile 638.
Does I have to change something?
Thanks for your help.
Best Regards, Thomas