Skip to content

odata startswith uri differs from odata standard and causes entity framework to generate suboptimal sql #236

@jgtestw

Description

@jgtestw

The code that converts a startswith predicate to an odata uri generates the following uri

startswith(mobile,'0430404111') eq true

instead of

startswith(mobile,'0430404111')

This causes the sql generated by entity framework to be suboptimal. Why do you tack eq true onto the end of the startswith? The odata standard does not require this. It also makes entity framework generate suboptimal sql:

((CASE WHEN ([Extent1].[Mobile] LIKE @p__linq__0 ESCAPE N''~'') THEN cast(1 as bit) WHEN ( NOT ([Extent1].[Mobile] LIKE @p__linq__0 ESCAPE N''~'')) THEN cast(0 as bit) END) = @p__linq__1)

instead of

[Extent1].[Mobile] LIKE @p__linq__0 ESCAPE N''~''

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions