Skip to content

String functions startswith and endswith don't work properly with apostrophe #60

@vkagamlyk

Description

@vkagamlyk

I tried different escape sequences, no one work.
LinqToQuerystringFilteringSample also don't allow search by apostrophe, crashes with exception.

Simple test (nunit)
[Test]
[TestCase("'", Result = 1)]
[TestCase("\'", Result = 1)]
[TestCase("''''", Result = 1)]
[TestCase("''", Result = 1)]
[TestCase(""", Result = 1)]
public int QueryWithApostrophe(string query)
{
var data = new Data[] { new Data("'hello"), new Data("one"), new Data("two"), new Data("three") };

        var result = data.AsQueryable().LinqToQuerystring(typeof(Data), "?$filter=startswith(tolower(Title),tolower('" + query + "')) eq true");

        return (result as IEnumerable<Data>).Count();
    }

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