I wanna do projection on fields of my collection and nested collection in each of entity, I use EntityFramework 6.2 I've do that with dynamic query like bellow code
Students.Select("new (Name,Family,new(Category.Name) as Category)");
it was worked but when I want to do that on the collection it's thrown error
Students.Select("new (Name,Family,new(Courses.Name,Courses.UnitName) as Courses)");
I want,it returns result as bellow code returns
Students.Select(std=>new{
std.Name,
Category=new{std.Category.Name},
Courses=std.Courses.Select(co=>new{
co.Name,co.UnitName
})}) ;
please if you have any idea share with me