Lazy loading crashes with "get_Info" not implemented under EF Core 3

2

I followed the docs telling me that since version 2.1, I can do the following.

services.AddDbContext<Context>(c => c
  .UseLazyLoadingProxies()
  .UseSqlServer(...));

It doesn't work throwing the exception below. Commenting out the UseLazyLoadingProxies part makes it function properly, it's the laziness that's to blame).

System.TypeLoadException HResult=0x80131522 Message=Method 'get_Info' in type 'Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal.SqlServerOptionsExtension' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation. Source=Microsoft.EntityFrameworkCore.SqlServer

I've installed the latest Microsoft.EntityFrameworkCore.Proxies version.

Install-Package Microsoft.EntityFrameworkCore.Proxies -Version 3.0.0-preview7.19362.6

When I googled, there was some info on lazy loading not being implemented in EF Core but I assumed that was in 1.x or simply incorrectly described.

What a I missing?

If it's not implemented, I wonder how on Earth I'm supposed to stop circular references when emitting an object with children on my WebAPI but that's another story. Googling that led me to using lazies, namely.

c#
entity-framework
.net-core
lazy-loading
ef-core-3.0

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0