LLBLGen "Smoothing" Table Relationships

I currently have two objects in LLBLGen and would like to concatenate them together for output to a table to be used in DevExpress GridControl in the same way as 2 tables concatenated together with an inner join.

Does anyone know how to do this with LLBLGen?

+2


source to share


2 answers


Then the alternative is to create a dynamic list (below code comes from the help file) - this is, unfortunately, rather verbose.



DataAccessAdapter adapter = new DataAccessAdapter();
ResultsetFields fields = new ResultsetFields(3);
fields.DefineField(EmployeeFields.FirstName, 0, "FirstNameManager", "Manager");
fields.DefineField(EmployeeFields.LastName, 1, "LastNameManager", "Manager");
fields.DefineField(EmployeeFields.LastName, 2, "AmountEmployees", "Employee", AggregateFunction.Count);
IRelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.Relations.Add(EmployeeEntity.Relations.EmployeeEntityUsingEmployeeId, "Employee", "Manager", JoinHint.None);

IGroupByCollection groupByClause = new GroupByCollection();
groupByClause.Add(fields[0]);
groupByClause.Add(fields[1]);
DataTable dynamicList = new DataTable();
adapter.FetchTypedList(fields, dynamicList, bucket, 0, null, true, groupByClause);

      

+2


source


If you are using LLBLGen 2.6, you can use LINQ to align the output using the LLBLGen LINQ Provider.

Something in the way (pseudocode)



var flat = from x in db.entitiesa()
           from y in db.entitiesb()
           select new { x.Name, y.Address }

      

and just move the variable "flat" to the grid control.

+3


source