예제 #1
0
 //temporary method
 public List <StudentCreditLogModel> GetUserCreditLog(string userid)
 {
     using (ChillLearnContext context = new ChillLearnContext())
     {
         var query = from logs in context.StudentCreditLogs
                     join c in context.Classes on logs.ClassID equals c.ClassID
                     where logs.UserID == userid
                     select new StudentCreditLogModel
         {
             ClassName    = c.Title,
             CreditsUsed  = logs.CreditsUsed,
             LogType      = logs.LogType,
             CreationDate = logs.CreationDate
         };
         return(query.ToList());
     }
 }
예제 #2
0
 public TeacherRepository(ChillLearnContext context)
 {
     this.context = context;
 }
예제 #3
0
 public StudentRepository(ChillLearnContext context)
 {
     this.context = context;
 }
예제 #4
0
 public Repository(ChillLearnContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }