Ejemplo n.º 1
0
 public IEnumerable Top5ProductsWithLowestStock()
 {
     return(productSet.Where("UnitsInStock > 0")
            .OrderBy("UnitsInStock")
            .Take(5)
            .Select(r => new { Name = r.GetString(0), UnitsInStock = r.GetInt16(1) }, "ProductName, UnitsInStock")
            .AsEnumerable());
 }
Ejemplo n.º 2
0
        public void Find()
        {
            var db = SqlServerNorthwindDatabase();

            SqlSet <SqlSetAnnotated.Model1.Product> table = db.Table <SqlSetAnnotated.Model1.Product>();

            Assert.IsNotNull(table.Find(1));
            Assert.IsNull(table.Where("ProductID = 2").Find(1));
        }
Ejemplo n.º 3
0
        public void ContainsKey()
        {
            var db = SqlServerNorthwindDatabase();

            SqlSet <SqlSetAnnotated.Model1.Product> table = db.Table <SqlSetAnnotated.Model1.Product>();

            Assert.IsTrue(table.ContainsKey(1));
            Assert.IsFalse(table.Where("ProductID = 2").ContainsKey(1));
        }