We use Adapter with the lates Version.
If there any way to get a EntityCollection with Duplicates (with prefetch objects)and use of a Content object
(We like to print duplicate labels from a printer pool (DruckPool).)
Our Report System needs EntityCollection because we use:
DataSet ds = GeneralUtils.ProduceEmptyDataSet(prefetchPath, new ElementCreator());
collection.CreateHierarchicalProjection(ds);
PrintReport(reportDefinition, ds)
Code to fill the collection. (but DISTINCT ist used):
IEntity2 entity = GeneralEntityFactory.Create((EntityType)entiyType);
EntityField2 field = (EntityField2)entity.PrimaryKeyFields[0];
DynamicRelation relation = new DynamicRelation((EntityType)entiyType, JoinHint.Inner, EntityType.DruckPoolEntity, string.Empty, string.Empty, field == DruckPoolFields.EntityID);
bucket.Relations.Add(relation);
bucket.PredicateExpression.Add(DruckPoolFields.DruckAusgabeID == druckAusgabe.DruckAusgabeID);
IPrefetchPath2 prefetchPath = GetPrefetchPath();
EntityCollection<EntityBase2> entitycollection = new EntityCollection<EntityBase2>(entity.GetEntityFactory());
Context context = new Context();
context.Add(entitycollection);
//entitycollection.DoNotPerformAddIfPresent = false;
DataAdapter.FetchEntityCollection(entitycollection, bucket, -1, null, prefetchPath);
Thank you.