Hi!
I've got a question about the correct use of ICriteria and Expression. I've got a simple example, loading a TMaterial-object where the corresponing Objects have the values "TestHouse"
and "TestName"
and "TestTitel".
Code:
ICriteria crit1 = session.CreateCriteria(TMaterial);
ICriteria crit2 = crit1.CreateCriteria("LocationId");
ICriteria crit3 = crit1.CreateCriteria("TMaterialContractorList");
ICriteria crit4 = crit1.CreateCriteria("ProgramId");
crit2.Add(Expression.Eq("LocationName", "TestHouse"));
crit3.Add(Expression.Eq("ContractorName", "TestName"));
crit4.Add(Expression.Eq("TitleOriginal", "TestTitel"));
object results = crit1.List();
But what I would like to get is all the Objects with the value of "TestHouse"
AND ("TestName"
OR "TestTitel") ...
Is there a way to get these results?
Thanks a lot for youtr help...!