Beispiel #1
0
        public static string JsText(this UpdateOperator op)
        {
            switch (op)
            {
            case UpdateOperator.Increment: return("++");

            case UpdateOperator.Decrement: return("--");

            default: throw new NotSupportedException();
            }
        }
Beispiel #2
0
 public CollectionOperators(DeleteOperator <T> deleteOperator,
                            ReplaceOperator <T> replaceOperator,
                            InsertOperator <T> insertOperator,
                            QueryOperator <T> queryOperator,
                            UpdateOperator <T> updateOperator)
 {
     Delete  = deleteOperator;
     Replace = replaceOperator;
     Insert  = insertOperator;
     Query   = queryOperator;
     Update  = updateOperator;
 }
Beispiel #3
0
 public UpdateExpression(UpdateOperator op, Expression argument, bool prefix, Location location = null) :
     base(SyntaxNodeType.UpdateExpression, location)
 {
     if (!FastEnumValidator <UpdateOperator> .IsDefined((int)op))
     {
         throw new ArgumentOutOfRangeException("op");
     }
     if (argument == null)
     {
         throw new ArgumentNullException("argument");
     }
     Operator = op;
     Argument = argument;
     Prefix   = prefix;
 }
        private static CollectionOperators <TDocumentRoot> CreateCollectionOperators <TInterface, TConcrete, TDocumentRoot>(
            IMongoCollection <TDocumentRoot> mongoCollection, IServiceProvider provider)
            where TDocumentRoot : class, IDocumentRoot
            where TConcrete : CallistoCollection <TDocumentRoot>, TInterface
        {
            var deleteOperator =
                new DeleteOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoDeleteOperationFactory>());
            var replaceOperator =
                new ReplaceOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoReplaceOperationFactory>());
            var queryOperator =
                new QueryOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoQueryOperationFactory>());
            var updateOperator =
                new UpdateOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoUpdateOperationFactory>());
            var insertOperator =
                new InsertOperator <TDocumentRoot>(mongoCollection, provider.GetRequiredService <ICallistoInsertOperationFactory>());

            var operators = new CollectionOperators <TDocumentRoot>(deleteOperator, replaceOperator,
                                                                    insertOperator, queryOperator,
                                                                    updateOperator);

            return(operators);
        }
Beispiel #5
0
 public PrefixUpdateExpression(AbstractUnaryExpression unaryExpression, UpdateOperator updateOperation, bool isStrictMode) : base(isStrictMode)
 {
     this.unaryExpression = unaryExpression;
     this.updateOperation = updateOperation;
 }
Beispiel #6
0
 public PostfixUpdateExpression(AbstractLeftHandSideExpression leftHandSideExpression, UpdateOperator updateOperation, bool isStrictMode) : base(isStrictMode)
 {
     this.leftHandSideExpression = leftHandSideExpression;
     this.updateOperation        = updateOperation;
 }
Beispiel #7
0
 public TestUpdate(UpdateOperator op, TestNode argument)
 {
     argumentNode = argument;
     this.op      = op;
 }
Beispiel #8
0
 public static UpdateExpression Update(UpdateOperator op, Expression argument, Location location)
 {
     return(new UpdateExpression(op, argument, true, location));
 }
Beispiel #9
0
 public static UpdateExpression Postfix(UpdateOperator op, Expression argument, Location location)
 {
     return(new UpdateExpression(op, argument, false, location));
 }
 public UpdateExpression(Identifier argument, UpdateOperator op)
 {
     Argument = argument;
     Operator = op;
 }
 public UpdateExpressionExecuter(UpdateExpression expr) : base(expr)
 {
     identifier = expr.Argument;
     op         = expr.Operator;
 }