Hello,
I have three tables in master-details schema : zones => secteurs => uga.
I can get a dataset with three datatables with the joined code.
But in the table "zones", I have an ID for a manager which complete name's is in the table "responsables".
How can I get the complete name in my projection in order to get it in the first datatable.
Any help will be welcome
Best regards
Daniel
Here's the code
var zones = new EntityCollection<ZonesEntity>();
var path = new PrefetchPath2(EntityType.ZonesEntity);
path.Add(ZonesEntity.PrefetchPathSecteurs).SubPath.Add(SecteursEntity.PrefetchPathUga);
using (var adapter = new DataAccessAdapter()) {
adapter.FetchEntityCollection(zones, null, path);
}
// setup projections per type.
List<IEntityPropertyProjector> zonesProjections = EntityFields2.ConvertToProjectors(
EntityFieldsFactory.CreateEntityFieldsObject(EntityType.ZonesEntity));
List<IEntityPropertyProjector> secteursProjections = EntityFields2.ConvertToProjectors(
EntityFieldsFactory.CreateEntityFieldsObject(EntityType.SecteursEntity));
List<IEntityPropertyProjector> ugaProjections = EntityFields2.ConvertToProjectors(
EntityFieldsFactory.CreateEntityFieldsObject(EntityType.UgaEntity));
List<IViewProjectionData> projectionData = new List<IViewProjectionData>();
projectionData.Add(new ViewProjectionData<ZonesEntity>(zonesProjections, null, false));
projectionData.Add(new ViewProjectionData<SecteursEntity>(secteursProjections, null, false));
projectionData.Add(new ViewProjectionData<UgaEntity>(ugaProjections));
var result = new DataSet("projectionResult");
zones.CreateHierarchicalProjection(projectionData, result);