BuildContainsExpression clause for Linq to Entities RRS feed

  • Question

  • Is there any reason why the below query fails as soon as I try to evaluate the IEnumerable if lstIDs that I pass in contains 15 ID's. It works with less than 15. I know the query is not optimized as I'm not querying using the PartitionKey or RowKey but I can't see why it fails. I can see that the query has been built and looks to be correct but I get this error message...

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>

    <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">


      <message xml:lang="en-US">One of the request inputs is not valid.







            public IEnumerable<TBLObject> GetObjects(List<string> lstIDs)


                var query = (from p in this.context.Objects

                                select p)

                                .Where(BuildContainsExpression<TBLObject, string>(tt => tt.ID, lstIDs));


                CloudTableQuery<TBLObject> cloudTableQuery = query.AsTableServiceQuery<TBLObject>();

                return cloudTableQuery.Execute();



    • Changed type nigelgos Monday, July 18, 2011 2:58 PM
    Monday, July 18, 2011 2:57 PM


  • Thank you for posting.

    After I checked your post, it looks that your questioin was related to Timestamp property.

    The Timestamp property is a DateTime value that is maintained on the server side to record the time an entity was last modified. The Table service uses the Timestamp property internally to provide optimistic concurrency. You should treat this property as opaque: It should not be read, nor set on insert or update operations (the value will be ignored).

    I suggest you can check this document for more information. http://msdn.microsoft.com/en-us/library/dd179338.aspx

    In addition, I suggest you can also consult your question into Windows Azure forum. http://social.msdn.microsoft.com/Forums/en/windowsazure/threads You may get more helpful suggestions there.

    Best Regards,

    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, July 20, 2011 7:28 AM