Ejemplo n.º 1
0
        public void ExecuteTypedShouldRewrite()
        {
            var rewriter   = new Rewriter();
            var expression = Expression.Call(typeof(System.Linq.Queryable), nameof(System.Linq.Queryable.Count), new[] { typeof(Dummy) }, query.Expression);

            var actual = new RewriteDbQueryProvider(query.Provider, rewriter).Execute <int>(expression);

            Assert.Equal(0, actual);
            Assert.True(rewriter.VisitCalled);
        }
Ejemplo n.º 2
0
        public DbQueryableTest()
        {
            rewriter = new Rewriter();

            query = Enumerable.Empty <Dummy>()
                    .AsQueryable()
                    .OrderBy(d => d.Id);

            provider = new RewriteDbQueryProvider(query.Provider, rewriter);
        }
Ejemplo n.º 3
0
        public void CreateQueryTypedShouldRewrite()
        {
            var actual = new RewriteDbQueryProvider(query.Provider, new Rewriter()).CreateQuery <Dummy>(query.Expression);

            AssertQuery(actual);
        }