views:

87

answers:

0

Hello,

I have the following problem, I need to query for null value using Data Services.

In C# I use:

DataServiceQuery<Sync.Doctor> query = syncEnt.Doctors as DataServiceQuery<Sync.Doctor>;
query.AddQueryOption("$filter", "(Id eq " + CurrentDoctor.Id + " and ((synch_date eq null and deleted eq 0) or (updated_at gt synch_date)))");

Then this generates:

http://localhost/odata.svc/Doctors()?$filter=(Id eq 575504 and ((synch_date eq null and deleted eq 0) or (updated_at gt synch_date)))

But this query simply putted in web browser ends with following error:

Operator 'eq' incompatible with operand types 'System.Boolean' and 'System.Int32'...

How can I filter with null comparison?

Regards, Daniel Skowroński