Skip to content

VB.NET entities cause an exception with EE Core #20390

@VBAndCs

Description

@VBAndCs

I published eShopOnWeb_VB.NET which is the VB.NET version of the Microsoft full web sample eShopOnWeb
The solution contains 3 projects:

  1. Web.vb (a VB.NET ASP.NET Core 3.1 project).
  2. Infrastructure.vb (a VB.NET .NET standard library project).
  3. ApplicationCore.cs (a C# .NET standard library project):
    The repo also contains a VB.NET version named ApplicationCore.vb, but if you referenced it in the solution instead of the C# version, it will causes a runtime exception. I couldn't find the source of this exception, and I compared the C# and VB.Net versions of the project and they seems identical, with no obvious VB.NET special behavior that can cause the exception.
    This project contains the database entities and other classes used in query operations.
    This is the exception:

InvalidOperationException: Lambda expression used inside Include is not valid.
Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.ProcessInclude(NavigationExpansionExpression source, Expression expression, bool thenInclude)

What is the source of this exception?
Is there any EF convention that can be broken by different naming of properties backing fields or something similar?
Is it related to expression tree that VB generates?
How can I solve this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions