Beispiel #1
0
        public void SqlQueryable_SingleOrDefault()
        {
            // Prepare the test data
            string[]            fields    = new[] { "Id", "Name" };
            IQueryable <Record> queryable = new SqliteQueryable(connection, "Course", "Alias", fields);

            // Perform the test operation
            Record record = queryable.SingleOrDefault();
        }
Beispiel #2
0
        public void SqlQueryable_SingleOrDefault_Predicate()
        {
            // Prepare the test data
            string[]            fields    = new[] { "Id", "Name" };
            IQueryable <Record> queryable = new SqliteQueryable(connection, "Course", "Alias", fields);

            // Perform the test operation
            Record record = queryable.SingleOrDefault(x => (int)x["Alias"]["Id"] == 2);

            // Check the test result
            Assert.AreEqual(2L, record["Alias"]["Id"]);
        }