Skip to content

Need to differentiate between TypedParameterExpression and FieldExpression #3

Open
@Shrp77

Description

@Shrp77

Hi,

I'm writing a custom SQL generator that parses LINQ expressions and turns them into SQL. I'm currently stuck at a point where I need to be able to differentiate between a TypedParameterExpression (internal, base type MemberExpression) and a FieldExpression (internal, base type MemberExpression).

The base LINQ I'm trying to resolve looks something like this:

var mock = new MockCompany();
var mock2 = new MockProgram
{
   Name = "Orange"
}

var query = mock
    .GenerateSelect()
    .Where(m => m.Name == mock2.Name);

When I get to the BinaryExpression, m.Name is a TypedParameterExpression and mock2.Name is a FieldExpression, however I cannot differentiate between them in order to process them differently.

Is there any way I can differentiate between them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions