Accepted Answer

You may accomplish that with Entity Framework 6 in the following way:

using (DatabaseContext context = new DatabaseContext()) {
    return context.JobDetails.Include(x => x.Likes).ToList();
}
1
9/16/2018 10:11:29 AM

Popular Answer

You may also get a number of lists and even nested data to supplement the response that was given.

List<item> items = db.mainData
    .Where(x => x.parentId == id)
    .Include(x => x.moreData)
            .ThenInclude(acc => acc.field)
    .Include(x => x.evenMoreData)
            .ThenInclude(acc => acc.field)
    .ToList();


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow