-1

My idea is to there are teacher with tests and student with notes. With identity 2 there are one table-USERS and roles. I set role to every user,but how can i set the notes and tests to the different users?!

TABLES Now: USER->USERROLES-ROLE My idea: TEACHER->TEST STUDENT->NOTE How i can do this with roles in mvvc identity 2

  • Explain it more, seems like you have Users >> Teacher and Student. Then you need to add specific role 'Test' to teachers and notes for Students? – DSR Sep 25 '14 at 13:37
  • see solution to your post at this post: http://stackoverflow.com/questions/21385582/mvc-5-asp-net-identity-implementation-confusion/30511153#30511153 – Moji Oct 07 '16 at 08:13

1 Answers1

0

Add a record to the AspnetUserRoles table that defines the association of a user to a role. Some people will have a record for Teacher and some for Students. This is an association table, with userid and roleid so if a record exists here it says user with id 123 is in role 345 which represents Teacher. Make sense?

Philip Nelson
  • 985
  • 6
  • 20