This example uses the Adapter scenario and is from Generated code - Advanced filter usage, Adapter - Multi-entity filters in the manual.
EntityCollection tracks = new EntityCollection(new TrackEntityFactory());
RelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.Relations.Add(TrackEntity.Relations.Tracks_GeneresEntityUsingTrackID);
bucket.Relations.Add(Tracks_GeneresEntity.Relations.GenereEntityUsingGenereID);
bucket.PredicateExpression.Add(GenereFields.Name == "Rock");
bucket.PredicateExpression.AddWithOr(GenereFields.Name == "Comedy");
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.FetchEntityCollection(tracks, bucket);