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()); }
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)); }
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)); }