This is really interesting:

http://nhforge.org/blogs/nhibernate/archive/2009/01/07/typesafe-icriteria-using-lambda-expressions.aspx

Expanding the syntax a bit, we can use:

session.CreateCriteria<Person>()
        .SetFetchMode(p => p.PersonDetail, FetchMode.Eager)
        .SetLockMode(LockMode.Upgrade)
        .Add(p=>p.Name.Like("foo"))
        .List();

That would remove a lot of the pressure to build a full fledged linq
provider.
And it seems like it is much easier to do.

Thoughts?

Reply via email to