Closed chikwekweg574 closed 3 years ago
Maybe checkout these examples: Building to Tenant and Tenant to Buildings.
You can always reference the projects locally to see if/where it's blowing up.
If that doesn't clear it up add a sample to a repo we can look at and see it failing.
I will try to reference the project locally that might highlight what I am missing. I had gone through the test cases and mappings but I am obviously missing something.
Firstly, thank you very much for this wonderful library, it's making my life much easier, much appreciated.
One thing I can't seem to be able to do is expand into child tables. I have a suspicion this might be the way my mappings are setup. As an example, I have a query as below: https://localhost:44382/odata/PersonTitles?$expand=Users
The users object is always empty; below is the output:
I can see in SQL that only the PersonTitles are queried with no join of any kind to the User(s) table. When I query from child to parent(https://localhost:44382/odata/Users?$expand=PersonTitle)- it expands fine.
My mapping is plain old (for all my models):
CreateMap<PersonTitle, PersonTitleDto>();
I am using the 'GetQueryAsync()' method
var personTitles = await _context.PersonTitles.GetQueryAsync(_autoMapper, options, null);
If I drop the library and use EnableQuery removing the need for mapping between the Dtos and the db entities it all works fine.
What could I be missing?
Thanks for your help.