Home
Options

DbContext Driver needs to support other options

in LinqPad 6 -- Please add the ability to configure the DbContext via the DbContextOptions<> -- specifically enabling "Lazy Loading" -- as it's a major feature loss in LINQPad without that enabled.

THANK YOU

Comments

  • Options
    edited February 2020

    LINQPad supports lazy loading with EF Core, and always has. Are you using a DbContext defined in your own assembly? If so, you must enable lazy loading in the OnConfiguring method:

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        ...
        optionsBuilder.UseLazyLoadingProxies ();
    }
    

    It's also possible to enable lazy loading only in conjunction with LINQPad. For an example, click the 'Help me choose' link on the connection dialog.

  • Options

    Good solution -- I'll implement. Thanks Joe!

Sign In or Register to comment.