-
I'm trying to figure out how to approach this problem. Given two entities. Operating in a READ-ONLY capacity. What would be the right mechanism to load all products that I own or am shared. I use the IAccessControlProvider to return Device[] which is working for the users own data. I'm stumped on how I would generate Device[] return with both owned and shared. Appreciate any guidance here. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
How would you do it in SQL and EF Core? Can you create a view within SQL? - Yes, just create an EF Core based image of the view. Devil is in the details here, so there is no "one size fits all" type of thing. |
Beta Was this translation helpful? Give feedback.
Thank you Adrian, the view was a nice way to accomplish.
For anyone wanting to do something like this in the future.
Added view "DevicesMerged" to db:
Set up Entity:
Setting up the entity to work via the view:
Created a IAccessControlProvider following this sample:
https://communitytoolkit.github.io/Datasync/in-depth/server/index.html#configure-access-permissions
Modified the class to SharedViewPrivateAccessContro…