Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What methods are allowed when using Linq? #576

Closed
weirdyang opened this issue Jul 17, 2024 · 7 comments
Closed

What methods are allowed when using Linq? #576

weirdyang opened this issue Jul 17, 2024 · 7 comments

Comments

@weirdyang
Copy link

I noticed I can not using ToLower() and .Contains, what else should I avoid?

@hishamco
Copy link
Contributor

hishamco commented Jul 17, 2024

YesSQL has some of LINQ like methods, but not all you can check the source code to know which are supported

https://github.com/sebastienros/yessql/blob/main/src/YesSql.Abstractions/IQuery.cs

@weirdyang
Copy link
Author

YesSQL has some of LINQ like methods, but not all you can check the source code to know which are supported

https://github.com/sebastienros/yessql/blob/main/src/YesSql.Abstractions/IQuery.cs

Sorry I meant the operators and methods I can use within the Linq methods, like those I've shared in my OP, eg. String.ToLower(), using String.ToLower() throws an exception.

@hishamco
Copy link
Contributor

ToLower() and Contains()` are string methods how they are related? Where did you call them?

@weirdyang
Copy link
Author

weirdyang commented Jul 17, 2024

Please see the op, I said within the linq extensions, eg Where(x => x.Name.ToLower() == "test").

Doing this will cause yessql to throw an exception.

For exampl in ef core using unsupported or untranslatable methods results in client side evaluation

For to linq to sql here are the unsupported string methods
https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/system-string-methods

@weirdyang weirdyang changed the title What extensions are allowed when using Linq? What methods are allowed when using Linq? Jul 17, 2024
@MikeAlhayek
Copy link
Collaborator

Here is a list

  • .StartsWith("") and .StartsWith('')
  • .EndsWith("") and .EndsWith('')
  • .Contains("") and .Contains('')
  • .Concat([""]) .Concat(""), .Concat("", ""), .Concat("", "", ""), and .Concat("","","","")
  • .Min(), .Max(), .Count(), .Average(), .Sum()
  • IsLike("")
  • IsNotLike("")
  • .NotContains("")
  • IsIn([])
  • IsNotIn([])

@weirdyang
Copy link
Author

Here is a list

  • .StartsWith("") and .StartsWith('')
  • .EndsWith("") and .EndsWith('')
  • .Contains("") and .Contains('')
  • .Concat([""]) .Concat(""), .Concat("", ""), .Concat("", "", ""), and .Concat("","","","")
  • .Min(), .Max(), .Count(), .Average(), .Sum()
  • IsLike("")
  • IsNotLike("")
  • .NotContains("")
  • IsIn([])
  • IsNotIn([])

thanks!!

@hishamco
Copy link
Contributor

DefaultQuery implements IQuery which I refer to last week :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants