This error appears to be triggered in the where clause when I am looking by primary key. I have found some resources that say it will throw an error when looking for a primary key that doesn't exist, rather than null.
The current solution is to wrap the query in an exception block:
try
{
var person = from item in Connection.Persons
where item.ID == id
select item;
return person;
}
catch( DataServiceQueryException ex )
{
return null;
}
No comments:
Post a Comment