【发布时间】:2012-02-22 00:59:19
【问题描述】:
我正在尝试设置一些数据库表并为教师、学生、课程、学期的主题创建一些模型类。这是针对 MVC3 Web 应用程序的。如果我有一个用户配置文件实体和模型类。如果我在 userprofile 模型类中创建一个分类枚举并且该枚举是教师或学生,它会起作用吗? Idk 如果这可行。我真的不知道我怎么能做到这一点,因为我需要学生注册的课程,对于老师,我需要他/她正在教授和教授的课程。任何建议将不胜感激。
例如,在 userprofile 类中可能是这样的:
class UserProfile {
public Guid UserID { get; set; }
public string fname { get; set; }
public string lname { get; set; }
public Classification classification { get; set; }
}
public enum Classification {
Student, Teacher
}
【问题讨论】:
标签: c# asp.net-mvc-3 enums