Hello...
I have my class X :
public class ClassX
{
public virtual IList<ClassY> ListY { get; set; }
...
}
My ClassX mapping (using Fluent)
...
HasMany<ClassX>(x => x.ListY )
.Inverse()
.Cascade.AllDeleteOrphan()
.KeyColumns.Add("`IDX`");
...
My Y class:
public class ClassY
{
...
public virtual ClassZ Z{ get; set; }
...
}
Mapping ClassY
...
References(x => x.Z, "IDZ").Cascade.None();
...
Now, I´d like to search all ClassX elements that have in ListY Z.ID = 2...
How can I do that using ICriteria?
Thanks