-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linq query -> JOIN -> Select -> All selected properties 'null' #382
Comments
Dear chironh
Issue was discovered 'by accident' due to having multiple queries on the same CRM tables, that generally select the same things.
So, I ran some tests, with a simple account query (for the purpose of doing it on a default entity), via a project for which I was doing unit tests.
Passed a real instance of the IOrgService instead of a fake one & did some tests. As soon as I split off the object selector into its own method, things failed as described.
As such, it was always a 'new/fresh run' with just 1 retrieve action performed during that run for testing (and as you can see from the screenshots, in debug mode).
Thus, it shouldn't be a context tracking issue.
NOTE: Haven't tried it yet via passing the object selector as a lambda, which is also a common thing to do if you want to have a generic method but allow the caller to specify columns.
I'd assume it'd fail just the same.
From: chironh ***@***.***>
Sent: Tuesday, 11 July 2023 13:06
To: microsoft/PowerPlatform-DataverseServiceClient ***@***.***>
Cc: Kevin Van Puyvelde ***@***.***>; Author ***@***.***>
Subject: Re: [microsoft/PowerPlatform-DataverseServiceClient] Linq query -> JOIN -> Select -> All selected properties 'null' (Issue #382)
Just to be sure: you're not experiencing a tracking issue on the context object here?
(as in: that specific account is not queried before?)
|
I deleted my comment right after initial posting it because I re-read the original message and I saw missed an important part where the query succeeded without using methods. |
I know I'm way behind on responding to this one, Sorry about that. The LINQ provider is in somewhat of a limbo state right now. I had fowarded this over to them to investigate but they have declined it at the moment. What I would suggest you do here is provide this feedback on the doc link for the LINQ provider to help raise some visibility on this. |
I seem to have found an issue in the Linq provider.
![image](https://private-user-images.githubusercontent.com/19588107/250586872-fc5115ca-4e32-4b47-b3c9-9d3d8641fe51.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MzI5NDEsIm5iZiI6MTcyMjQzMjY0MSwicGF0aCI6Ii8xOTU4ODEwNy8yNTA1ODY4NzItZmM1MTE1Y2EtNGUzMi00YjQ3LWIzYzktOWQzZDg2NDFmZTUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDEzMzA0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBhYzU2OTZiOWUxN2MzODcwM2U5ODlhYzNhY2UzYzg4Zjc2ZDczOGI0ZjAwNzc4MWVjZDQ0ZjAzN2NkMGRhYTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.lAVpLrH8Bh2lZZrHUVaOB63JAk2N0h4-zIT4Vl8uEeA)
Consider the following simple query
This works just fine, as you'd expect. We get the details of our contact & some info on the joined account.
![image](https://private-user-images.githubusercontent.com/19588107/250587354-5617743f-0f17-4248-a55f-00719fd38668.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MzI5NDEsIm5iZiI6MTcyMjQzMjY0MSwicGF0aCI6Ii8xOTU4ODEwNy8yNTA1ODczNTQtNTYxNzc0M2YtMGYxNy00MjQ4LWE1NWYtMDA3MTlmZDM4NjY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDEzMzA0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhMmQwODZlNWYxNWQ3YzQ2YjFhNjY5YzQyYTlmN2E2ZTlmZGMyMGM2NGEzZDRkYmRlNjI2NzI0ZTVkYzI5NWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ryba_TS463ICQfzQS-NxqZHvaFqKmoOKzOBAfO2YGFg)
However, if we're selecting a load of properties (or if we have multiple queries looking for the same fields), you'd ideally want to split the selections out into their own selector functions.
Aiight, easy enough ...
You'd expect that'd be the end of it. But the problem is that this only kinda works.
![image](https://private-user-images.githubusercontent.com/19588107/250587526-423e9a92-6d1b-4686-87f2-a140e2b509b3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MzI5NDEsIm5iZiI6MTcyMjQzMjY0MSwicGF0aCI6Ii8xOTU4ODEwNy8yNTA1ODc1MjYtNDIzZTlhOTItNmQxYi00Njg2LTg3ZjItYTE0MGUyYjUwOWIzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzMxVDEzMzA0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRhNTQxYzFmM2U3ODgyODY0MzYzOTM0ZTViZTNiMGQxNGY4YzkzYWFmNzQ1OWZiOTRkNjBkMGJlMDc2ZGFmYmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.-0ZAt3HA2DGOuXSrxB2dc4i_mU9MkZu5PyzCEzPyFGo)
The contact details are selected as expected. The account properties however are included in the 'Attributes' list, but they're all 'NULL'.
CURRENT BEHAVIOR: Joined entity information is not selected by the DataVerse queryprovider.
EXPECTED BEHAVIOR: Joined entity details are selected by the DataVerse queryprovider.
The text was updated successfully, but these errors were encountered: