Last post May 28, 2014 12:13 PM by Lacutas
May 28, 2014 11:30 AM|Lacutas|LINK
I'm using the out of the box authentication with an MVC 5 project and EF 6. This works great and saves alot of time, but I'm struggling on how to get it linked up to my custom database structure.
For example, I have a table of "Movies" and each movie should be linked to a specific user. When loading a list of movies for a user, it should only pull their own movies. I'm guessing I need to add a UserId into the Movies class but how do I go about
setting modelling this and ensuring this security is enforced?
Thanks for any help provided.
May 28, 2014 11:45 AM|AidyF|LINK
It's just a case of adding a userid to your own table and setting a relationship between your custom table and the membership users table. I cover it here
May 28, 2014 12:13 PM|Lacutas|LINK
Sorry found exactly what I want here: