Example #1
0
        public static void DeleteEntryList <TModel>(this ARProxy <TModel> proxy, Expression <Func <TModel, bool> > expression)
            where TModel : ARBaseForm
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression must not null. If want to delete all entries, try to use m => true");
            }
            ConditionExpressionVisitor visitor = new ConditionExpressionVisitor();
            var             expEvaled          = Evaluator.PartialEval(expression);
            ConditionResult tr = visitor.Translate(expEvaled);
            string          qu = tr.Qulification == null ? null : tr.Qulification.ToString();

            proxy.DeleteEntryList(qu);
        }
Example #2
0
        public static IList <TModel> GetEntryList <TModel>(this ARProxy <TModel> proxy,
                                                           Expression <Func <TModel, bool> > expression,
                                                           uint StartIndex,
                                                           uint?RetrieveCount,
                                                           TotalMatch totalMatch,
                                                           List <ARSortInfo> sortInfo,
                                                           params Expression <Func <TModel, object> >[] propertiesTobeUp)
            where TModel : ARBaseForm
        {
            if (expression == null)
            {
                throw new ArgumentNullException("expression must not null. If want to delete all entries, try to use m => true");
            }
            ConditionExpressionVisitor visitor = new ConditionExpressionVisitor();
            var             expEvaled          = Evaluator.PartialEval(expression);
            ConditionResult tr = visitor.Translate(expEvaled);
            string          qu = tr.Qulification == null ? null : tr.Qulification.ToString();

            return(GetEntryList(proxy, qu, StartIndex, RetrieveCount, totalMatch, sortInfo, propertiesTobeUp));
        }
 public ConditionExpressionVisitor()
 {
     tr = new ConditionResult();
     tr.Qulification = new StringBuilder();
 }
 public ConditionExpressionVisitor()
 {
     tr = new ConditionResult();
     tr.Qulification = new StringBuilder();
 }