'Load referenced data types from custom Identity UserManager

I have a custom IdentityUser called ApplicationUser:

public class ApplicationUser : IdentityUser
{
    public ICollection<Board> Boards { get; set; }
}

When loading a user with _userManager.GetUserAsync(User) in a handler method, it loads an ApplicationUser but without the Boards collection. When working directly with an DbContext, I would use _context.User.Include(u => u.Boards) but this isn't possible with the UserManager?

How do I solve this issue?


My ApplicationDbContext currently looks like this:

public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
        : base(options)
    {
    }
}




Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source