示例#1
0
        static void SubFilter()
        {
            var subFilter = new FilterLite <Product>()
                            .Where(ProductFields.SupplierId, 1)
                            .Or(ProductFields.SupplierId, OperatorLite.IsNull);

            // SELECT * FROM dbo.Products WHERE CategoryId = 1 AND (SupplierId = 1 OR SupplierId = 2)
            IList <Product> products = ds.ProductRepository.Query(Projection.BaseTable)
                                       .Where(ProductFields.CategoryId, 1)
                                       .And(subFilter)
                                       .ToList();
        }
示例#2
0
        static void SubFilter()
        {
            var subFilter = new FilterLite<Product>()
                        .Where(ProductFields.SupplierId, 1)
                        .Or(ProductFields.SupplierId, OperatorLite.IsNull);

            // SELECT * FROM dbo.Products WHERE CategoryId = 1 AND (SupplierId = 1 OR SupplierId = 2)
            IList<Product> products = ds.ProductRepository.Query(Projection.BaseTable)
                            .Where(ProductFields.CategoryId, 1)
                            .And(subFilter)
                            .ToList();
        }