Closed TripleNico closed 4 years ago
I did some further digging and i manage to narrow it down. It happens when i call two queries that has an expand with the same name of the other query object.
For example:
dsqOrders = CType(WebCon.Orders.Expand("Customer").Take(MaxTop), DataServiceQuery(Of Order)) dsqCustomers = CType(WebCon.Customers.Expand("CustomerRoles").Take(MaxTop), DataServiceQuery(Of Customer))
Now i call the execute and convert the response to list:
lstOrders = dsqOrders.Execute.ToList lstCustomers = dsqCustomers.Execute.ToList
When i Now loop through the List of Customers and check if Customer.CustomerRoles collection has no item that some of the items in the collection have no items in them and other do. When i check the response with Wireshark i can see (as confirmed in the earlier post) that the data is send. The data is missing in both collections, dsqCustomers and lstCustomers. So it isn't the problem of the .ToList method.
But when i remove .Expand("Customer")
from the Orders query than everything works like a charm. It doesn't matter which calling order i use. (first orders then customers or first customers then orders). Hopefully this information helps you?
Hi, @TripleNico
I suppose that the issue is not related to the code generated by the connected service, but to the OData client library used.
Therefore, you should create this issue in this repository.
When i try to update a large class with several collections (large) in it than it can occur when calling .execute that not all collections are updated. If i check in whireshark i can see that the data is there.
For example i call: GET /odata/v1/Customers()?$top=99999&$expand=Orders,BillingAddress,BillingAddress/Country,ShippingAddress,CustomerRoles,Addresses
Wireshark:
DataServiceQuery:
If i test it in a loop like:
Then i cannot reproduce it. It seems to occur "random". I know this isn't much and will try to get more debug information, but maybe in te meantime you got an idea what is going wrong?