You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
ovyshnevskyy
changed the title
BadLinqExpressionException when calling string.Trim an Marten 7 does not (yet) support member string.Trim
BadLinqExpressionException when calling string.Trim
Jun 20, 2024
Marten has never supported string.Trim() in LINQ expressions. Maybe it didn't throw an exception on before, but that's not something that's ever been explicitly supported -- an you literally have to explicitly write code to handle every damn thing you could possibly do in LINQ because it's not magic.
This wasn't something that was on my radar at all. Happy to take a PR for this if you want to dive into it. Start with StringMember
After upgrade to Marten "7.19.1" we get next error:
Marten.Exceptions.BadLinqExpressionException
Marten does not (yet) support member string.Trim
In previous version of Marten next code works fine:
return (await GetAsync(
tenantId,
values => values.Where(x => x.Name.Trim().Equals(name.Trim(), StringComparison.OrdinalIgnoreCase)),
cancellationToken))
.FirstOrDefault();
Are you going to fix this in next versions?
The text was updated successfully, but these errors were encountered: