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

Adding LIKE operator for EF6 #131

Closed
czielin opened this issue Dec 23, 2017 · 4 comments
Closed

Adding LIKE operator for EF6 #131

czielin opened this issue Dec 23, 2017 · 4 comments

Comments

@czielin
Copy link
Contributor

czielin commented Dec 23, 2017

I'm trying to figure out if there is a way to add to call a method that translates to the TSQL LIKE operator when executing against Sql Server using EF6. It looks like this was done for EF Core here:

#105

I was going to take a crack at using the commit for this issue to see if I could add something myself, but I'm unable to get the solution to build. When I load it in VS 2017 the nuget dependencies refuse to load and I am presented with the following error.

Error MSB4019 The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. System.Linq.Dynamic.Core C:\Program Files\dotnet\sdk\2.0.2\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.targets 41

I've tried this on two different machines. Do I need my environment set up in a particular way to load this solution?

Further, is this worth the time investment, or is there some reason this will not work like it does for EF Core?

Thanks!

@czielin
Copy link
Contributor Author

czielin commented Dec 23, 2017

Please disregard (for now).

Even though I couldn't build digging into the project helped me discover that it already references the proper EF6 classes, and I think I've figured out the proper syntax.

queryable.Where("parts.any(DbFunctions.Like(common.type, @0)) ", "%test");

@StefH
Copy link
Collaborator

StefH commented Dec 23, 2017

Cool. Does this work for you?

@StefH
Copy link
Collaborator

StefH commented Dec 24, 2017

About the solution ; you need UWP to be installed;

uwp

@czielin
Copy link
Contributor Author

czielin commented Dec 26, 2017

@StefH it took me a bit to build some tests around it, but now that I have the syntax worked out it all appears to be working well. Thanks!

Thanks also for the tip on UWP. I will give that a shot should I need to dive into the code again.

@czielin czielin closed this as completed Dec 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants