I get profile information with the following:
var profiles = connection.Query<Models.PROFILE>("SELECT * FROM PROFILES WHERE ID=@ID ", new { ID = profileID });
The profile object contains other collections, such as profileImages. The problem is that the number of elements for each child is zero. I also want to get data, say, profileImages.
Is there something that needs to be configured to query child objects, and if so, is it possible to indicate which one and how many levels?
I also tried multimapping:
var profiles = connection.Query<Models.PHOTOS_PERMISSIONS, Models.PROFILE, Models.PHOTOS_PERMISSIONS>(sql, (p1, p2) => { p1.ID = profileID; return p1; }, new { ID = profileID }, splitOn: "OWNER_PROFILESIDFK, ID").AsQueryable();
PHOTOS_PERMISSIONS.OWNER_PROFILESIDFK = PROFILE.ID
And getting the following error:
When using the multiple display APIs, be sure to specify the splitOn parameter if you have keys other than Id Parameter name: splitOn
I tried options for what is splitOn in my text, but still getting the same error.
Elhaix
source share