예제 #1
0
        public void Expression_from_static_delegate_with_parameter()
        {
            using (var context = new SimpleModelContext())
            {
                var products = context.Products.Where(StaticExpressions.DelegateWithParameter(1));

                Assert.DoesNotThrow(() => products.ToList());
            }
        }
예제 #2
0
        public void Expression_embedded_static_delegate_with_parameter()
        {
            using (var context = new SimpleModelContext())
            {
                var products = context.Products
                               .Where(p => context.Products.Where(StaticExpressions.DelegateWithParameter(1))
                                      .Contains(p));

                products.ToList();
            }
        }