public List <Course_tbl> GetCourses() { using (LMSDBEntities db = new LMSDBEntities()) { C_List = db.Course_tbl.ToList(); } return(C_List); }
public override string[] GetRolesForUser(string username) { using (LMSDBEntities db = new LMSDBEntities()) { var userRoles = new List <string>(); if (db.Student_tbl.Any(user => user.Email == username)) { userRoles.Add("Student"); } else if (db.Lecturer_tbl.Any(user => user.Email == username)) { userRoles.Add("Lecturer"); } else if (db.Admin_tbl.Any(user => user.Email == username)) { userRoles.Add("Admin"); } return(userRoles.ToArray()); } }