c# - Web service WHERE / ORDER BY (?) -


I have a web service that lists all customers.

Receive all such data in Gridview by calling the method I can get the list.

  test.RH_WebServiceService ligar = new test.RH_WebService (); Test.baseList [] data = ligar.getAllData ();   

I want to filter it by name (for example) I'm reading online and people have told me that I can do this:

  test.baseList [] data = ligar.getAllData (). Where (condition);   

Although I can not get it to work, do you have any ideas?

Assume that you are using Linq, you can simply:

  test.baseList [] data = ligar.getAllData () Where (d = & gt; d.name == "john");   

D is a random letter given to an object. The name that I am assuming is that your property is called. Although I recommend making a method in your service, in which you enter the name and get the filtered data back. This way you can only return the data you expected, which will improve performance. Something like this:

  test.baseList [] data = ligar.getDataByName ("John");    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -