-1

I have multiple tables that refer to other tables in my database.

I can select the entries of one table and the refered entries. In the refered table is also a table refered.

How can I load all linked tables with one query in Microsoft Entity Framework?

Tables: Devices <=> Interfaces <=> information

it-person
  • 98
  • 1
  • 11

1 Answers1

-1

Use Include()

using (var context = new BloggingContext()) 
{ 
    // Load all blogs and related posts 
    var blogs1 = context.Blogs 
                          .Include(b => b.Posts) 
                          .ToList(); 
}

See this

Oscar
  • 13,594
  • 8
  • 47
  • 75