Please note that it is a pseudo code - the original is less clear then this one.
AEntity ret = new AEntity(someParameter);
IPrefetchPath2 path = new PrefetchPath2((int)EntityType.AEntity);
IPrefetchPath2 BPath = path.Add(AEntity.PrefetchPathB, 0, null, null, new SortExpression(BFields.SomeField | SortOperator.Ascending)).SubPath;
//
IPredicateExpression complicatedPredicate = new PredicateExpression((new PredicateExpression(CEntity.AQQ== 5)).AddWithOr(new PredicateExpression(new FieldCompareSetPredicate(CEntity.AQQ, null, CEntity.AQQ, null, SetOperator.In, new PredicateExpression(CEntity.B_ID == CEntity.B_ID).AddWithAnd(CEntity.AQQ == 5), true)).AddWithAnd(CEntity.AQQ == DBNull.Value)));
IPrefetchPath2 svAnswerPath = BPath.Add(BEntity.PrefetchPathC, 0, complicatedPredicate, null, new SortExpression(CFields.SomeField | SortOperator.Ascending)).SubPath;
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntity(ret, path);
}