当前位置: 首页>>代码示例>>C#>>正文


C# Request.AddDataItem方法代码示例

本文整理汇总了C#中Request.AddDataItem方法的典型用法代码示例。如果您正苦于以下问题:C# Request.AddDataItem方法的具体用法?C# Request.AddDataItem怎么用?C# Request.AddDataItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Request的用法示例。


在下文中一共展示了Request.AddDataItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Request

        public override Request Request(Request request)
        {
            //if (_document.ORID != null)
            //    throw new InvalidOperationException();

            //CorrectClassName();

            //string className = _document.OClassName.ToLower();
            //var clusterId = _database.GetClusters().First(x => x.Name == className).Id;
            //_document.ORID = new ORID(clusterId, -1);

            base.Request(request);
            int transactionId = 1;

            request.AddDataItem(transactionId);
            request.AddDataItem((byte)(UseTransactionLog ? 1 : 0)); // use log 0 = no, 1 = yes

            foreach (var item in _records)
            {

                item.AddToRequest(request);
            }

            request.AddDataItem((byte)0); // zero terminated

            request.AddDataItem((int)0);

            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:29,代码来源:CommitTransaction.cs

示例2: Request

        public override Request Request(Request request)
        {
            // standard request fields
            request.AddDataItem((byte)_operationType);
            request.AddDataItem(request.SessionId);

            // operation specific fields
            if (OClient.ProtocolVersion > 7)
            {
                request.AddDataItem(OClient.DriverName);
                request.AddDataItem(OClient.DriverVersion);
                request.AddDataItem(OClient.ProtocolVersion);
                request.AddDataItem(OClient.ClientID);
            }
            if (OClient.ProtocolVersion > 21)
            {
                request.AddDataItem(OClient.SerializationImpl);
            }

            if (OClient.ProtocolVersion > 26)
            {
                request.AddDataItem((byte)(request.Connection.UseTokenBasedSession ? 1 : 0)); // Use Token Session 0 - false, 1 - true
            }
            request.AddDataItem(UserName);
            request.AddDataItem(UserPassword);

            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:28,代码来源:Connect.cs

示例3: Request

        public override Request Request(Request request)
        {
            base.Request(request);

            CorrectClassName();

            if (_document.ORID == null)
            {
                var clusterId = _database.GetClusterIdFor(_document.OClassName);
                _document.ORID = new ORID(clusterId, -1);
            }

            if (OClient.ProtocolVersion < 24)
            {
                request.AddDataItem((int)-1);  // data segment id
            }

            request.AddDataItem((short)_document.ORID.ClusterId);
            request.AddDataItem(Serializer.Serialize(_document));
            request.AddDataItem((byte)ORecordType.Document);
            request.AddDataItem((byte)((OperationMode == OperationMode.Synchronous) ? 0 : 1));


            return request;
        }
开发者ID:mdekrey,项目名称:OrientDB-NET.binary,代码行数:25,代码来源:RecordCreate.cs

示例4: Request

 public Request Request(int sessionID)
 {
     Request request = new Request();
     request.AddDataItem((byte)OperationType.DB_LIST);
     request.AddDataItem(sessionID);
     return request;
 }
开发者ID:workshare,项目名称:OrientDB-NET.binary,代码行数:7,代码来源:DBList.cs

示例5: Request

        public override Request Request(Request request)
        {
            base.Request(request);

            request.AddDataItem(Key);
            request.AddDataItem(Value);
            return request;

        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:9,代码来源:ConfigSet.cs

示例6: Request

        public Request Request(int sessionID)
        {
            Request request = new Request();

            // standard request fields
            request.AddDataItem((byte)OperationType.CONFIG_LIST);
            request.AddDataItem(sessionID);
            return request;
        }
开发者ID:PaybackMan,项目名称:Cinder,代码行数:9,代码来源:ConfigList.cs

示例7: Request

        public override Request Request(Request request)
        {
            base.Request(request);

            request.AddDataItem((short)_orid.ClusterId);
            request.AddDataItem((long)_orid.ClusterPosition);

            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:9,代码来源:RecordMetadata.cs

示例8: Request

        public override Request Request(Request request)
        {
            base.Request(request);

            // operation specific fields
            request.AddDataItem(DatabaseName);
            if (OClient.ProtocolVersion >= 16) //since 1.5 snapshot but not in 1.5
                request.AddDataItem(StorageType.ToString().ToLower());

            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:11,代码来源:DbExist.cs

示例9: Request

        public override Request Request(Request request)
        {
            base.Request(request);

            // operation specific fields
            request.AddDataItem(DatabaseName);
            request.AddDataItem(DatabaseType.ToString().ToLower());
            request.AddDataItem(StorageType.ToString().ToLower());

            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:11,代码来源:DbCreate.cs

示例10: Request

        public Request Request(int sessionID)
        {
            Request request = new Request();

            request.AddDataItem((byte)OperationType.RECORD_METADATA);
            request.AddDataItem(sessionID);

            request.AddDataItem((short)_orid.ClusterId);
            request.AddDataItem((long)_orid.ClusterPosition);

            return request;
        }
开发者ID:PaybackMan,项目名称:Cinder,代码行数:12,代码来源:RecordMetadata.cs

示例11: Request

        public virtual Request Request(Request request)
        {
            request.AddDataItem((byte)_operationType);
            request.AddDataItem(request.SessionId);

            if (OClient.ProtocolVersion > 26 && request.Connection.UseTokenBasedSession)
            {
                request.AddDataItem(request.Connection.Token);
            }

            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:12,代码来源:BaseOperation.cs

示例12: Request

        public override Request Request(Request request)
        {
            base.Request(request);

            request.AddDataItem(_orid);
            request.AddDataItem(_fetchPlan);

            if (OClient.ProtocolVersion >= 9) // Ignore Cache 1-true, 0-false
                request.AddDataItem((byte)0);
            if (OClient.ProtocolVersion >= 13) // Load tombstones 1-true , 0-false
                request.AddDataItem((byte)0);
            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:13,代码来源:LoadRecord.cs

示例13: Request

        public override Request Request(Request request)
        {
            base.Request(request);

            request.OperationMode = OperationMode.Synchronous;

            // collection pointer
            request.AddDataItem(FileId);
            request.AddDataItem(PageIndex);
            request.AddDataItem(PageOffset);

            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:13,代码来源:SBTreeBonsaiFirstKey.cs

示例14: Request

        public override Request Request(Request request)
        {
            base.Request(request);

            request.AddDataItem(ConfigKey);
            return request;
        }
开发者ID:emman-ok,项目名称:OrientDB-NET.binary,代码行数:7,代码来源:ConfigGet.cs

示例15: AddToRequest

        public void AddToRequest(Request request)
        {
            request.AddDataItem((byte)1); // undocumented but the java code does this
            request.AddDataItem((byte)RecordType);
            request.AddDataItem(ORID.ClusterId);
            request.AddDataItem(ORID.ClusterPosition);
            request.AddDataItem((byte)ORecordType.Document);

            switch (RecordType)
            {
                case RecordType.Create:
                    request.AddDataItem(GetDocument().Serialize());
                    break;
                case RecordType.Delete:
                    request.AddDataItem(Version);
                    break;
                case RecordType.Update:
                    request.AddDataItem(Version);
                    //request.AddDataItem((byte)1);
                    request.AddDataItem(GetDocument().Serialize());
                    if (OClient.ProtocolVersion >= 23)
                    {
                        request.AddDataItem((byte)1); // updateContent flag 
                    }
                    break;

                default:
                    throw new InvalidOperationException();
            }

        }
开发者ID:workshare,项目名称:OrientDB-NET.binary,代码行数:31,代码来源:TransactionRecord.cs


注:本文中的Request.AddDataItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。