Home
Options

LINQPad 5 connection to EF Core 3.1.x typed context in a .NET Framework 4.6.1 DLL

Hi!

We just started using EF Core 3.1.10 in a .NET 4.6.1 project. My understanding is that I need to keep using LINQPad 5 and not go to 6, because the assembly being connected to is a .NET Framework assembly, not .NET Core (despite it using EF Core inside). IOs that correct? If so, how do I connect to it from LINQPad? I was able to do this with EF6 just fine before.

When I try to set up a connection with typed data context using EF Core driver, I get:
Method not found: 'System.Type.Microsoft.EntityFrameworkCore.Metadata.IProperty.get_ClrType()'

I installed the custom EF Core driver in LINQPad, but it says it's EF Core 2.x and I don't see one available to download that is 3.x. Would a specific EF Core 3.x driver be needed for LINQPad to be able to connect to it? If so, is that something that will be available for LINQPad 5?

Thanks.

Comments

  • Options
    edited December 2020

    Or asked more plainly, does LINQPad 5 currently support connecting to an EF Core 3.x DbContext located inside a .NET Framework 4.6.1 assembly? If not, is that driver being planned at all?

  • Options

    LINQPad 5 doesn't support EF Core 3.x. One option that you have is to target or multi-target your project so that it produces a .NET Standard assembly. Then you'll be able to use that assembly in LINQPad 6.

  • Options
    edited April 2021

    Hi
    I have the same issue. We use EF Core 3.1 in a .NETStandard2.0 project.
    https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.Relational/3.1.0

    Do I have to use LINQPad5 oder LINQPad6?
    I guess it is LINQPad5 as the project does not target the .NETStandard2.1
    But there is no EF Core 3.x driver :#

    Is there any solution for this combination?

    -> Solved by multi-targeting the projects containing the EF entities
    -> Now i'm able to use LinqPad6 :):)

  • Options

    @PiMattmann does the multi-targeting have any trade-offs for your project/solution? Do you have any resources you might be able to point me to regarding this? I have a solution with multiple projects in it (.NET Framework 4.6.1 with ASP.NET MVC project and some .NET Framework 4.6.1 class libraries) so I just want to be careful with any implications of multi-targetting.

Sign In or Register to comment.