Beispiel #1
0
        IQueryable IQueryProvider.CreateQuery(Expression expression)
        {
            var translator = new QueryStringTranslator();

            QueryStringQuery = translator.Translate(expression);
            return(this);
        }
        public void an_equality_check_is_created()
        {
            var qst = new QueryStringTranslator();
            Expression<Func<Customer, bool>> query = c => c.FirstName == "Ian";
            var TheResult = qst.Translate(query);

            TheResult.ShouldBe("FirstName eq 'Ian'");
        }
Beispiel #3
0
        IQueryable <TElement> IQueryProvider.CreateQuery <TElement>(Expression expression)
        {
            var translator = new QueryStringTranslator();

            QueryStringQuery = translator.Translate(expression);
            if (typeof(TElement) == typeof(T))
            {
                return((IQueryable <TElement>) this);
            }
            return(new ResourceContext <TElement>());
        }