sjh37/EntityFramework-Reverse-POCO-Code-First-Generator

Bug in 3.8.0 with optionsBuilder.UseLazyLoadingProxies()

nealculiner opened this issue · 2 comments

I updated to 3.8.0 and I'm not on EF Core 7 yet, still using EF Core 6 per my .tt settings below. My solution is throwing an error now when building after this update:

    Settings.DatabaseType            = DatabaseType.SqlServer; // SqlServer, SqlCe, PostgreSQL. Coming next: MySql, Oracle
    Settings.TemplateType            = TemplateType.EfCore6; // EfCore7, EfCore6, EfCore5, EfCore3, EfCore2, Ef6, FileBasedCore2-7. FileBased specify folder using Settings.TemplateFolder
    Settings.GeneratorType           = GeneratorType.EfCore; // EfCore, Ef6, Custom. Custom edit GeneratorCustom class to provide your own implementation
    Settings.FileManagerType         = FileManagerType.EfCore; // .NET Core project = EfCore; .NET 4.x project = VisualStudio; No output (testing only) = Null

Error CS1061 'DbContextOptionsBuilder' does not contain a definition for 'UseLazyLoadingProxies' and no accessible extension method 'UseLazyLoadingProxies' accepting a first argument of type 'DbContextOptionsBuilder' could be found (are you missing a using directive or an assembly reference?)

As I realized I was using EF Core 7 I changed TemplateType to TemplateType.EfCore7 and still get the same error.

Just read release notes (of course, do this last):

Include call to .UseLazyLoadingProxies() if Settings.UseLazyLoading = true. Please install the Microsoft.EntityFrameworkCore.Proxies NuGet package.