Exemplo n.º 1
0
        protected ITransactionOperation CreateTransactionOperation(TransactionType transactionType)
        {
            ITransactionOperation transactionOperation;

            switch (transactionType)
            {
            case TransactionType.CreateNode:
                transactionOperation = new CreateNode(MapObjects.Parameters);
                break;

            case TransactionType.DeleteNode:
                transactionOperation = new DeleteNode(MapObjects.Parameters);
                break;

            case TransactionType.CreateRelationship:
                transactionOperation = new CreateRelationship(MapObjects.Parameters);
                break;

            case TransactionType.DeleteRelationship:
                transactionOperation = new DeleteRelationship(MapObjects.Parameters);
                break;

            case TransactionType.CreateDescriptor:
                transactionOperation = new CreateDescriptor(MapObjects.Parameters);
                break;

            case TransactionType.CreateMetadata:
                transactionOperation = new CreateMetadata(MapObjects.Parameters);
                break;

            case TransactionType.UpdateMetadata:
                transactionOperation = new UpdateMetadata(MapObjects.Parameters);
                break;

            case TransactionType.DeleteMetadata:
                transactionOperation = new DeleteMetadata(MapObjects.Parameters);
                break;

            case TransactionType.UpdateNode:
                transactionOperation = new UpdateNode(MapObjects.Parameters);
                break;

            case TransactionType.UpdateRelationship:
                transactionOperation = new UpdateRelationship(MapObjects.Parameters);
                break;

            case TransactionType.UpdateDescriptor:
                transactionOperation = new UpdateDescriptor(MapObjects.Parameters);
                break;

            default:
                throw new NotSupportedException("The requested transaction type doesn't exist.");
            }

            return(transactionOperation);
        }
Exemplo n.º 2
0
        public static List <object> GetRelatedUpdates(IUpdate update, UpdateRelationship type)
        {
            List <object>    ret     = new List <object>();
            UpdateCollection related = update.GetRelatedUpdates(type);

            foreach (IUpdate relupdate in related)
            {
                object o = Update.GetRelatedUpdateObject(update, relupdate);
                ret.Add(o);
            }

            return(ret);
        }