I have a problem with multiple contditions.
I need to use AND ... in the filter
ResultsetFields fields = new ResultsetFields(2);
fields.DefineField(HeartbeatStatusFields.Datum, 0);
fields.DefineField(HeartbeatStatusFields.StatusId, 1);
fields[1].ExpressionToApply = new DbFunctionCall("MAX", new object[] { HeartbeatStatusFields.Datum });
IGroupByCollection gcol = new GroupByCollection();
gcol.Add(HeartbeatStatusFields.StationId);
DerivedTableDefinition dtDefinition = new DerivedTableDefinition(fields, "b", null, gcol);
IPredicate fillter = (new EntityField2(HeartbeatStatusFieldIndex.StationId.ToString(), "b", typeof(string)) == HeartbeatStatusFields.StationId.SetObjectAlias("a"));
// IPredicate fillter2 = (new EntityField2(HeartbeatStatusFieldIndex.Datum.ToString(), "b", typeof(string)) == HeartbeatStatusFields.Datum.SetObjectAlias("a"));
// specify the relation which is a dynamic relation.
DynamicRelation relation = new DynamicRelation(dtDefinition, JoinHint.Inner, EntityType.HeartbeatStatusEntity, "a", fillter);
RelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.Relations.Add(relation);
bucket.SelectListAlias = "a"; // entities should target the aliased order table.
// fetch the data
EntityCollection<HeartbeatStatusEntity> heartbeats = new EntityCollection<HeartbeatStatusEntity>();
adapter.FetchEntityCollection(heartbeats, bucket);
How do i add the code piece AND a.Datum = b.max_date from the select above in the llblgen code ?