'Create dynamic entity from nested classes to bind Devexpress net core Data Grid

I have a data transfer object like this :

public class PerformanceCostDto
{
    public int Id { get; set; }
    public long WorkId { get; set; }
    public string WorkTitle { get; set; } //For example: Work1
    public List<UserCostDto> UserCosts { get; set; }
} 
public class UserCostDto 
{
    public int Id { get; set; }
    public long UserId { get; set; }
    public string UserFullName { get; set; } //For example: Smith, john, ...
    public long TotalCost { get; set; } //For example: 1250, 545, ...
}

Now, I filled this DTO with complicated queries in Linq. But How can I select records to bind Devexpress net core Data Grid like this table with EF Core:

WorkTitle    Smith    John    ...
---------    -----    ----    
  Work1      1250     545 

   


Solution 1:[1]

For the future : As @SvyatoslavDanyliv Said:

I flattened result (Merge UserCostDto into PerformanceCostDto) Then Pivot Grid will run all needed queries to show grouped data.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bsflasher