Exemple #1
0
        public void Expression_from_static_method_with_parameter()
        {
            using (var context = new SimpleModelContext())
            {
                var products = context.Products.Where(StaticExpressions.MethodWithParameter(1));

                products.ToList();
            }
        }
        public void Expression_embedded_static_method_with_parameter()
        {
            using (var context = new SimpleModelContext())
            {
                var products = context.Products
                               .Where(p => context.Products.Where(StaticExpressions.MethodWithParameter(1))
                                      .Contains(p));

                Assert.DoesNotThrow(() => products.ToList());
            }
        }