I am trying to create a social networking application for students and teachers. I am currently designing the user accounts module
I have thought of these two approaches
Approach 1
Public class Account
{
public string AccountId{get;set;}
public string AccountName{get;set;}
.
.
.
}
public class Student : Account
{
public Course[] Courses {get; set;}
//other student properties
.
.
.
}
public class Teacher : Account
{
//other teacher properties
}
Approach 2
Public class Account
{
public string AccountId{get;set;}
public string AccountName{get;set;}
public AccountType AccountType {get;set;} //AccontType is enum having student and teacher
.
.
.
}
public class User
{
public string UserId { get;set;}
public string UserName {get;set;}
public Account Account {get;set;}
}
public class Student : User
{
public Course[] Courses {get; set;}
//other student properties
.
.
.
}
public class Teacher : User
{
//other teacher properties
}
Is there any better approach than these approaches?