Create a Criterion object to add to a Detached/ICriteria later?

2 views
Skip to first unread message

reach4thelasers

unread,
Nov 27, 2009, 10:05:18 AM11/27/09
to NhLambdaExtensionsUsers
Hello all,

Just asked this over at StackOverflow, does anybody here have any
ideas?

http://stackoverflow.com/questions/1809247/nhlambdaextensions-create-a-criterion-object-to-add-to-icriteria-later

Basically I need to make a Criterion object using NHLambdaExtensions.
So that I can add it later to a Detached/ICriteria to build up a query
dynamically

Somehing like this:
ICriterion criterion = Restrictions.Eq<Person>(p=> p.Name == "John");

which sadly isn't valid! Any ideas?

Richard Brown

unread,
Nov 27, 2009, 10:39:42 AM11/27/09
to nhlambdaext...@googlegroups.com

Hi Kev,

I think you can use:

SqlExpression.CriterionFor<Person>(p => p.Name == "John")

Richard

Sent from my Android phone.


--

You received this message because you are subscribed to the Google Groups "NhLambdaExtensionsUsers" group.
To post to this group, send email to nhlambdaext...@googlegroups.com.
To unsubscribe from this group, send email to nhlambdaextension...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhlambdaextensionsusers?hl=en.


reach4thelasers

unread,
Nov 28, 2009, 6:25:55 PM11/28/09
to NhLambdaExtensionsUsers
Worked great Richard! Thanks!!

On Nov 27, 3:39 pm, Richard Brown <fluke...@googlemail.com> wrote:
> Hi Kev,
>
> I think you can use:
>
> SqlExpression.CriterionFor<Person>(p => p.Name == "John")
>
> Richard
>
> Sent from my Android phone.
>
> On 27 Nov 2009 15:05, "reach4thelasers" <kev.m.mul...@googlemail.com> wrote:
>
> Hello all,
>
> Just asked this over at StackOverflow, does anybody here have any
> ideas?
>
> http://stackoverflow.com/questions/1809247/nhlambdaextensions-create-...
>
> Basically I need to make a Criterion object using NHLambdaExtensions.
> So that I can add it later to a Detached/ICriteria to build up a query
> dynamically
>
>  Somehing like this:
> ICriterion criterion = Restrictions.Eq<Person>(p=>  p.Name == "John");
>
> which sadly isn't valid!  Any ideas?
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "NhLambdaExtensionsUsers" group.
> To post to this group, send email to
> nhlambdaext...@googlegroups.com.
> To unsubscribe from this group, send email to
> nhlambdaextension...@googlegroups.com<nhlambdaextensionsusers%2Bunsu...@googlegroups.com>
> .
Reply all
Reply to author
Forward
0 new messages