本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: Request
public Request Request(int sessionID)
{
Request request = new Request();
request.AddDataItem((byte)OperationType.DB_LIST);
request.AddDataItem(sessionID);
return request;
}
示例5: Request
public override Request Request(Request request)
{
base.Request(request);
request.AddDataItem(Key);
request.AddDataItem(Value);
return request;
}
示例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;
}
示例7: Request
public override Request Request(Request request)
{
base.Request(request);
request.AddDataItem((short)_orid.ClusterId);
request.AddDataItem((long)_orid.ClusterPosition);
return request;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例14: Request
public override Request Request(Request request)
{
base.Request(request);
request.AddDataItem(ConfigKey);
return request;
}
示例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();
}
}