Multiple filters can be added using the $top parameter to limit the results if the handling of $top is implemented on the server side.
If you want to add multiple filter conditions, follow the steps below:
<add key="CountryCode1" value="DE" /> <add key="CountryCode2" value="US" />
string countryCode1 = ConfigurationReaderHandler.Instance.GetConfigValue("CountryCode1"); string countryCode2 = ConfigurationReaderHandler.Instance.GetConfigValue("CountryCode2");
When a project is generated, the SAP.IW.GWM.Common dll will be created in the References folder under the Solution Explorer region. In this DLL, there is a class ConfigurationReaderHandler that contains the method GetConfigValue that is used to read the configuration maintained in App.config at runtime, hence in the above code, we are calling the method in the ConfigurationReaderHandler class.
//var serviceresponse = serviceContext.BusinessPartnerCollection.Execute() as QueryOperationResponse<GWDEMO.BusinessPartner>; and add the following code snippet QueryOperationResponse<GWDEMO.BusinessPartner> serviceresponse = null; if (string.IsNullOrEmpty(countryCode1) && string.IsNullOrEmpty(countryCode2)) { serviceresponse = serviceContext.BusinessPartnerCollection.Execute() as QueryOperationResponse<GWDEMO.BusinessPartner>; } else { serviceresponse = serviceContext.BusinessPartnerCollection.AddQueryOption("$filter", string.Format("CountryCode eq '{0}' or CountryCode eq '{1}' ", countryCode1,countryCode2)).Execute() as QueryOperationResponse<GWDEMO.BusinessPartner>; }