3

I using entity framework for my database and select or/and include revealing so many data so basically i'm looking for query like this:

var result = DbContext.products
            .select(p=> new {
             p.Id,
             p.Name,
             p.Notes
             .select(n=> new {
                n.date,
                n.text
                             }
            });
0

1 Answer 1

6

You can use this code:

var result = DbContext.products
        .select(p=> new {
                         Id = p.Id,
                         Name = p.Name,
                         SelectedNodes = p.Notes.select(n=> 
                                             new {n.date, n.text}).ToList()                            
        });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.