Example #1
0
        public virtual void Where()
        {
            AstoriaTestLog.WriteLineIgnore("Calling Where");

            //Sub model - projections
            PredicateModel model  = new PredicateModel(this.Workspace, this.ResContainer, this.property, this.ParentRelKey, this.ResType);
            ModelEngine    engine = new ModelEngine(this.Engine, model);

            engine.Run();

            ExpNode e = model.Result;

            this.ParentRelKey = e as KeyExpression;
            if (null == _parentKey)
            {
                /* no keys for resource type*/
                this.Reload();
                return;
            }

            int i = this.Engine.Options.Random.Next(0, 10);

            if (i % 7 == 0)
            {
                e       = ((KeyExpression)e).Predicate;
                bFilter = true;
            }

            if (e != null)
            {
                if (_query is ScanExpression)
                {
                    _query = ((ScanExpression)_query).Where(e) as PredicateExpression;
                }
                else if (_query is NavigationExpression)
                {
                    _query = ((NavigationExpression)_query).Where(e) as PredicateExpression;
                }

                bWhere  = true;
                IsKey   = true;
                _action = LastAction.Where;
                AstoriaTestLog.WriteLineIgnore(".Where()");
            }
        }
Example #2
0
        public virtual void Where()
            {

                AstoriaTestLog.WriteLineIgnore("Calling Where");

            //Sub model - projections
            PredicateModel model = new PredicateModel( this.Workspace, this.ResContainer, this.property, this.ParentRelKey, this.ResType );
            ModelEngine engine = new ModelEngine( this.Engine, model );
            engine.Run();

            ExpNode e = model.Result;

            this.ParentRelKey = e as KeyExpression;
            if (null == _parentKey)
                {
                /* no keys for resource type*/
                this.Reload();
                return;
                }

            int i = this.Engine.Options.Random.Next( 0, 10 );
            if (i % 7 == 0)
                {
                e = ((KeyExpression)e).Predicate;
                bFilter = true;
                }

            if (e != null)
                {
                if (_query is ScanExpression)
                    _query = ((ScanExpression)_query).Where( e ) as PredicateExpression;
                else if (_query is NavigationExpression)
                    _query = ((NavigationExpression)_query).Where( e ) as PredicateExpression;
                
                bWhere = true;
                IsKey = true;
                _action = LastAction.Where;
                AstoriaTestLog.WriteLineIgnore( ".Where()" );
                }
            }