static void ViewTest() { var str = ""; using (var db = new SqliteDbContext()) { var list = db.VStats.Where(p => p.CLASS_NAME == str && p.POINTS == 9).ToList(); foreach (var item in list) { Console.WriteLine($"{item.STUDENT_NAME}\t{item.CLASS_NAME}\t{item.SUBJECT_NAME}\t{item.POINTS}"); } } }
static void CountTest() { using (var db = new SqliteDbContext()) { var l1 = db.Student.Join(db.Class, p => p.CLASS_ID, p => p.CLASS_ID, (pl, pr) => new { pl.CLASS_ID, pl.STUDENT_ID, pl.STUDENT_NAME, pr.CLASS_NAME }); var l2 = db.Score.Join(db.Subject, p => p.SUBJECT_ID, p => p.SUBJECT_ID, (pl, pr) => new { pl.SCORE_ID, pl.STUDENT_ID, pl.SUBJECT_ID, pl.POINTS, pr.SUBJECT_NAME }); var l3 = l1.Join(l2, p => p.STUDENT_ID, p => p.STUDENT_ID, (pl, pr) => new { pl.STUDENT_NAME, pl.CLASS_NAME, pr.SUBJECT_NAME, pr.POINTS }); foreach (var item in l3) { Console.WriteLine($"{item.STUDENT_NAME} {item.CLASS_NAME} {item.SUBJECT_NAME} {item.POINTS}"); } //db.JoinTable.Where(p => p.TEST_ID < 10000).ToList(); } }