Skip to content

Dynamic LINQ writer/visitor: Enum handling #63

@zspitz

Description

@zspitz

Currently, the following code:

public class Person {
    public DateTime DOB {get; set;}
}
Expression<Func<Person, bool>> expr = p => p.DOB.DayOfWeek == DayOfWeek.Tuesday;
Console.WriteLine(expr.ToString("Dynamic LINQ");

produces:

int(DOB.DayOfWeek) == 2

We have to check for 1. a comparison of 2. a numeric type and 3. an enum value converted to the numeric type. See #25, and https://github.com/zspitz/ExpressionTreeToString/blob/master/Library/CodeWriterVisitors/CodeWriterVisitor.cs#L29.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions