public void SqlQueryable_Contains_Chained() { // Prepare the test data IQueryable <Record> query = new SqliteQueryable(connection, "Course", new[] { "Id", "Name" }); // Perfor the test operation bool result = query.Contains(x => x["Course"]["Id"], 1); // Check the test result Assert.IsTrue(result); }
public void SqlQueryable_Contains_SubQuery() { // Prepare the test data IQueryable <Record> outer = new SqliteQueryable(connection, "Course", new[] { "Id", "Name" }); IQueryable <Record> inner = new SqliteQueryable(connection, "CourseStudent", new[] { "Id", "CourseId" }); // Perfor the test operation Record[] records = outer .Where(x => inner.Contains(y => y["CourseStudent"]["CourseId"], x["Course"]["Id"])) .ToArray(); // Check the test result Assert.AreEqual(ConnectionTestHelper.CountCourses, records.Length); }