Grouping on Navigation Property EF core RRS feed

  • Question

  • User527076549 posted


    I have a class like below

    public class Test


    public string field1 {get;set;}

    public string field2 {get;set;

    public virtual List<SecondTest> secondTest {get;set;}


    and i have code like 

      _context.Text.where(somecondition).Include(x=>x.secondTest).OrderBy().  returns List<Test>

    So i want grouped secondTest.. ,returning all fields in it. Is it posiible, i tried something like below it throws me error.Can any one guide me ?

    _context.Text.where(somecondition).Include(x=>x.secondTest.GroupBy(y=>new {y.field1,y.field2})).OrderBy().

    Thanks in advance, really appreciate your help.

    Friday, May 22, 2020 8:18 AM

All replies

  • User-821857111 posted

    You should provide a working example of what you are trying to do, and provide details of the actual error message.

    Friday, May 22, 2020 2:38 PM