Click here to Skip to main content
14,930,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please find the below query that we are sending from the from fe (react ) when we are trying to search with two text boxes .It doesnt return any result.

However an oData query with two dropdowns / onetextbox and one dropdown works/single textbox works

we suspect that this is due to the fact that two eq /one contains works fine however two contaisn doesnt work
https://locallhost/api/odata/pageoverview?$count=true& $filter=(contains(OccasionName,%27ifrs_17%27)%20and%20contains(Name2,%27Test%27))&$

Please provide a way in which odata query with two textbox that is two contains can work

Edit: (Posted as solution by OP)
The full URL is
https://localhost:3333/OverviewItem?$count=true&$filter=(contains(name1,'seek') and contains(name2,'aron') &$orderby=name1 desc,name2 desc &$skip=0&$top=10

Even I removed after the $ part still same issue then we find that Odataqueryoptions in GET action which receives the filter value controller is having wrong values like its sending as name1 aron intead of seek
C#
public IQueryable Get(ODataQueryOptions odata) { //// }

Why would the OdataQuery Options in backend mix up the values even if frontend has correct values

What I have tried:

we have tried change to eq it works but we wanted to select any string that contains
Posted
Updated 7-Jan-21 0:43am
v3

1 solution

The full URL is  
https://localhost:3333/OverviewItem?$count=true&$filter=(contains(name1,'seek') and contains(name2,'aron') &$orderby=name1 desc,name2 desc &$skip=0&$top=10

Even i removed after the $ part still same issue then we find that Odataqueryoptions in GET action which receives the filter value controller is having wrong values like its sending as name1 aron intead of seek 


public IQueryable Get(ODataQueryOptions odata) { //// }


Why would the OdataQuery Options in backend mix up the values even if frontend has correct values 
   
Comments
Maciej Los 7-Jan-21 5:00am
   
This is not an answer. Please, delete it to avoid down-voting. To update your question, use Improve question[^] widget.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900