I'm building an api using asp.net web api for an application that needs to track all the activities performed by users. So in every table I need to have createdUser and updatedUser field with their dates. But I faced some challenges on how to go about.
Here are my concerns:
How can I have that in the User table itself? Which type of relationship do I need for that?
I have a privilege table than can be created by required users. What type of relationship can I have between the Privilege and the User table?
I'm new to Entity Framework so I need some guides. Please can anyone be very kind to provide some help. Thank you
I don't think u wil need to have that logic in the user table itself. U can add extra colomn's to each table with CreUser,CreDate, LModUser, LModDate. Or U can create an extra table like Entity_ID, Record_ID, User_ID, ModDate, IsCreated. (or with other logic)
search for many to many relations on google. or:
How to create a many-to-many mapping in Entity Framework?
this is a nice tutorial for all kind of relationships in EF for core http://www.learnentityframeworkcore.com/configuration/one-to-many-relationship-configuration
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.