I have a table that contains user permissions for various objects/entities that looks like:
object_type //an enum referring the the type of object that this record applies to
object_id //the id of the object
user_id
can_edit
etc.
This would be related to several other tables in my project that don't really have anything in common (photos would be one example). To get the permissions for an object I would like to be able to do something like:
//get the first photo along with all of the user permissions related to it
context.Set<Photos>()
.Include(p=>p.UserPermissions)
.FirstOrDefault(p=>p.Id == 1)
I can restructure the database if need be, so I'd like to here what you think the best solution for this is.