I have seen a few answers to similar questions, however I cannot seem to work out how to apply the answer to my issue.
var allposts = _context.Posts
try this
var allposts = _context.Posts .Include(p => p.Comments) .Include(a => a.PostAuthor) .Where(t => t.PostAuthor.Id == postAuthorId).ToList(); _context.Attachments.Where(o=>o.Owner is Author).ToList();