jlhunter
unread,May 29, 2012, 7:36:03 PM5/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nhu...@googlegroups.com
I can't figure out how to get NHibernate to map to Int16.
In the class, public virtual Int16 ClientId { get; set; }
In the XML, name="ClientId" column="clnt_id" type="short"
It works when I use:
var member = session.CreateCriteria<Member>()
.Add(Restrictions.Eq("ClientId", 500))
.Add(Restrictions.Eq("MemberId", 45629))
.List<Member>();
but not:
var member = session.Query<Member>().Where(x => x.ClientId == 500 && x.MemberId == 45629).ToList();
The latter passes in Int32 for ClientId, not Int16. This causes issues as the column type is smallint (it takes about 40 seconds longer when passing in Int32, don't have a full grasp of what's happening).
I'm not sure how to map LINQ to use Int16.
Thanks