title: Problems with an OData filter and a Guid field
body: <p>I’m trying to get some code working using OData. The following bit of code doesn’t seem to work.</p>
  
  <p><strong>ds</strong> is OpenDataServiceProxy.</p>
  
  <p><strong>adapterTypeId</strong> is the string representation of a Guid.</p>
  
  <p><strong>adapterName</strong> is a string name</p>
  
  <pre><code>ds.query('/DataAdapters?$filter=DataAdapterType.DataAdapterTypeId eq guid(\'' + adapterTypeId + '\') and Name eq \'' + adapterName + '\'', ifmgr_CreateAdapter_Step1, onGenericFailure, 'Error');
  </code></pre>
  
  <p>The above line give the following error:</p>
  
  <p>Expression of type ‘System.Boolean’ expected at position 0.</p>
  
  <p>If I remove the Guid section of the filter so that it’s just using the “Name” part it works fine. </p>
  
  <p>The DataAdapters table field “DataAdapterTypeId” is foreign keyed to the “DataAdapterTypes” table DataAdapterTypeId field.</p>
  
  <p>Can anyone spot what I’m doing wrong?</p>
  
  <p>-------------------EDIT----------------------</p>
  
  <p>OK, I've changed the filter as shown below. I no longer get an error but get lots of results back rather than one record that matches the filter. Can anyone say why it's not filtering?</p>
  
  <pre><code>ds.query('/DataAdapters?($filter=Name eq \'' + adapterName + '\' and $filter=DataAdapterTypeId eq guid\'' + adapterTypeId + '\')', ifmgr_CreateAdapter_Step1, onGenericFailure, '');
  </code></pre>