0

I do not wish to know why it's better to use QueryOver and that it's newer.

How can I translate the following QueyOver to a DetachedCriteria:

QueryOver<Category>().Where(x => x.Properties.Any(y => y.Locales.Any(l => l.Value.Name == "propName")));

I don't know if the "Any" extension method is recognized by nhibernate but you can understand what I'm trying to accomplish.

Adam Tal
  • 5,911
  • 4
  • 29
  • 49

1 Answers1

2
var subquery = DetachedCriteria.For<Category>()
    .CreateCriteria("Properties")
        .CreateCriteria("Locales")
            .Add(Expression.Eq("Name", "propName"));
Firo
  • 30,626
  • 4
  • 55
  • 94