Session.Query<Event>().Where(e => e.EventCategory.Id ==
eventCategory).ToList();
I have no idea about what you are trying to do with IQueryExpression there.
Diego
On Sun, Aug 8, 2010 at 14:12, baws <[email protected]> wrote:
> Hi I want to rewrite the below to use linq in nh 3.0.0, I don't know
> if I am even going in the right direction here, but stuck at creating
> an IQueryExpression.
>
> IQueryExpression queryExpression = "select top 1 * from
> Table1";
> IQuery query =
> Session.GetISession().CreateQuery(queryExpression);
>
> Any help is much appreciated.
>
> public IList<Event> GetByCategoryID(System.Int32 eventCategory)
> {
> ICriteria criteria =
> Session.GetISession().CreateCriteria(typeof(Event));
>
>
> ICriteria eventCategoryCriteria =
> criteria.CreateCriteria("EventCategory");
>
> eventCategoryCriteria.Add(NHibernate.Criterion.Expression.Eq("Id",
> eventCategory));
>
> return criteria.List<Event>();
> }
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>
--
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.