I am designing a database for a language learning center. I have 3 subjects to manage: admin
, teacher
and student
.
Admin
can assign the role to the other 2 objectsteacher
has the role of posting instructions on the websiteStudents
can register for the course and payShould I create a teacher
and a student
table in the database? If so - how should I design them? Otherwise how should I manage just one user object?
I designed the AppUser
class to inherit the identity user class, the student and teacher classes inherit from the AppUser
class, is that a good approach?
A better solution is to create a teacher and a student table in the database. Because their roles are completely different, this can separate their respective businesses completely. Reduce the complexity of design.
Create a login page, you can provide a drop-down list for users to choose their own roles, query the database according to the user's role, and then fill the user and the user's role to identity to achieve authentication.