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

Is this support netcoree 3.1? #45

Closed
arhen opened this issue Mar 12, 2020 · 8 comments
Closed

Is this support netcoree 3.1? #45

arhen opened this issue Mar 12, 2020 · 8 comments

Comments

@arhen
Copy link

arhen commented Mar 12, 2020

I got error

The type or namespace name 'DataTablesParser' could not be found (are you missing a using directive or an assembly reference?)
@garvincasimir
Copy link
Owner

I can't think of any reason why it wouldn't work. Did you import the NuGet package?

@arhen
Copy link
Author

arhen commented Mar 15, 2020

Its error when I publish with every target build except portable

@garvincasimir
Copy link
Owner

The library is only one file. I suggest just copying the code into your project and see if it works.

@arhen
Copy link
Author

arhen commented Mar 18, 2020

I see, Ill close it now. Thanks

@arhen arhen closed this as completed Mar 18, 2020
@earllocker
Copy link

I ran into an issue with .NET Core 3.1. If using a boolean field in your filter, the conversion ToString() in the GenerateEntityFilter function will cause an exception as it cannot properly be translated on the server. I think it's caused by this issue: dotnet/efcore#14205

@garvincasimir
Copy link
Owner

You can probably exclude Boolean from search so it won’t get added to the where clause. Do you search for strings “true” and “false”?

@earllocker
Copy link

earllocker commented May 9, 2021

I have boolean fields that need to be filtered so will have to find a workaround. It doesn't matter if I search for "true" and "false" or "0" and "1" (which worked in .NET Core 2.1). The ToString() function on a boolean will cause evaluation on the client. At least in my testing. You can try a where clause similar to .Where(x => x.boolField.ToString().Equals("true")) on the iQueryable before sending it to the DataTables Parser and it will produce the same exception.

@garvincasimir
Copy link
Owner

garvincasimir commented May 25, 2021

You can find another built-in function that will convert a Boolean to a string then put that in a UDF. Once that is done you can replace the .ToString() call on your Boolean fields with the call to the UDF. The Readme explains how to replace the .ToString() call.

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