06-28-2013 08:29 PM
I am creating an application in c# to return data using SData.
I have already created the foundation of the program and I am able to connect and return data, but I would like to run more complex queries, and I am wondering if that is possible and if there are any examples out there, or if someone could provide some examples.
Basically I would like to give the user the option to create very granular conditions on their queries.
I would like to search for a KB articles and allow the user to search for Title, Description, Tags, and Content.
Each of these fields could have granular conditions like you might find when creating conditions when adding a new group.
Title needs to contain "ABC" and "XYZ", so it would only return a result if both those conditions are met.
Title could contain "ABC" or "XYZ", so it would return and articles with "ABC" or "XYZ"
Title could contain "ABC" or "XYZ" but NOT "DEF"
Right now I am using an example from "customerfx"
// This part is optional (without it we'd be getting ALL contacts). // This is our where clause, or condition of which contacts we want. // In this example we want all contacts whose last name starts with // the value 'Ab'. We need to use the exact property name as defined // in the entity (case-sensitive). req.QueryValues.Add("where", "LastName like 'Ab%'");
In this example can you turn that into a more complex query like I am looking for?
Or would I be better off caching all the articles locally, updating whenever there are new ones, and leveraging the power of c# to parse the data I want?
06-29-2013 05:04 AM
Here's some links to SData specs you will find useful: