-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Need help with ICriteria interface within NHibernate (C#)
PostPosted: Tue Jul 28, 2009 8:38 am 
Newbie

Joined: Tue Jul 28, 2009 8:28 am
Posts: 18
Hi I'm looking for help with getting the latest NHibernate to work with my .Net 3.5 VS 2008 project that I am migrating from .Net 2.0 on VS 2005. Previously (VS 2005 .Net 2.0) I would use the folling lines to query the database:

Code:
ICriteria criteria = mSession.CreateCriteria(typeof(Application));
criteria.Add(new EqExpression("ReferenceNumber", "2008/0128/NEW", true));
BCApplication application = (Application)criteria.UniqueResult();


This does not work in .Net 3.5 as I cannot seem to find EqExpression. In .Net 2.0 version of Nhibernate it is contained within NHibernate.Expression.EqExpression however .Net 3.5 version of NHibernate does not have the Expression class.

I'm having a nightmare googling this, so can someone please help me!!


Top
 Profile  
 
 Post subject: Re: Need help with ICriteria interface within NHibernate (C#)
PostPosted: Tue Jul 28, 2009 10:07 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
criteria.Add(Restrictions.Eq(("ReferenceNumber", "2008/0128/NEW", true)))

_________________
--Wolfgang


Top
 Profile  
 
 Post subject: Re: Need help with ICriteria interface within NHibernate (C#)
PostPosted: Tue Jul 28, 2009 10:35 am 
Newbie

Joined: Tue Jul 28, 2009 8:28 am
Posts: 18
Good job thanks :-D


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.