locked
join,count,contains support? RRS feed

  • Question

  • Is the join,count,contains keywords going to be supported in the production release of Data Services? Currently in CTP1 they are not.

    Friday, March 7, 2008 1:30 PM

Answers

  •  

    I assume you are talking about the Linq support in the Astoria client library. 

     

    The Linq to URI translator is constrained by what is supported in the underlying URI syntax being translated to.  Hence, since join, count & contains are not supported - the Linq translation does not support those operations.

     

    You can work around this by calling AsEnumerable() on Linq queries and process those operations on the client, i.e.

     

    (from c in context.Customers

    where c.Naem != "Smith"

    select c.Name).AsEnumerable().Contains("Jones");

     

    For some scenarios, the cost of fetching the data to do a client side operation may be tolerable.  The other option is to create an Service operation on the server which does the desired operation. 

     

    We are thinking of adding support for Count into the URI syntax since we know this is a failry common scenario and bringing down the entire list of desired entities to get an count is unreasonable.

     

    Friday, March 7, 2008 5:09 PM
    Moderator

All replies

  •  

    I assume you are talking about the Linq support in the Astoria client library. 

     

    The Linq to URI translator is constrained by what is supported in the underlying URI syntax being translated to.  Hence, since join, count & contains are not supported - the Linq translation does not support those operations.

     

    You can work around this by calling AsEnumerable() on Linq queries and process those operations on the client, i.e.

     

    (from c in context.Customers

    where c.Naem != "Smith"

    select c.Name).AsEnumerable().Contains("Jones");

     

    For some scenarios, the cost of fetching the data to do a client side operation may be tolerable.  The other option is to create an Service operation on the server which does the desired operation. 

     

    We are thinking of adding support for Count into the URI syntax since we know this is a failry common scenario and bringing down the entire list of desired entities to get an count is unreasonable.

     

    Friday, March 7, 2008 5:09 PM
    Moderator
  • Are we going to see Count implemented in the next release? At least with the URI syntax? This is something that would be really useful!

     

    Wednesday, April 30, 2008 9:52 PM