DataServiceQuery<T> issue with ToList<T>() RRS feed

  • General discussion

  • DataServiceQuery<TEntity> q = this.GetDetailsQuery<UtilityCustomerDetail>(ctxt, query, p1 );                

    List<TEntity> q.ToList<TEntity>();

    returns a list with the correct number of items; but the items are all the same?

    using Fiddler the service is returning the correct data?

    has any one see this before? any help would be great.


    Grahame Horner

    Wednesday, March 6, 2013 4:22 PM

All replies

  • Hi,

    Do you use compiled query?

    Sunday, March 10, 2013 2:14 PM
  • Hi,

    If you look at the payload from the server, do all the entities have the same value for the id element (atom:id in case of ATOM, the id or uri property in case of JSON)? If so, that this is expected behavior. OData requires all entities to have unique ids. The client uses this fact. So if the server returns two entities with the same id, the client thinks it's the same entity just sent twice (and depending on merge options will either take the first or last values).


    Vitek Karas [MSFT]

    Sunday, March 10, 2013 9:07 PM