本文整理汇总了C#中Result.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Result.GetValue方法的具体用法?C# Result.GetValue怎么用?C# Result.GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result.GetValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public long Add(string key, long num)
{
int status = keyspace_client.Keyspace_Add(cptr, key, num);
if (status < 0)
{
result = new Result(keyspace_client.Keyspace_GetResult(cptr));
throw new Exception(Status.ToString(status));
}
if (IsBatched())
return 0;
result = new Result(keyspace_client.Keyspace_GetResult(cptr));
try
{
return long.Parse(result.GetValue());
}
catch (FormatException)
{
throw new Exception(Status.ToString(Status.KEYSPACE_API_ERROR));
}
}
示例2: Count
public long Count(string prefix, string startKey, ulong count, bool skip, bool forward)
{
int status = keyspace_client.Keyspace_Count(cptr, prefix, startKey, count, skip, forward);
result = new Result(keyspace_client.Keyspace_GetResult(cptr));
if (status < 0)
throw new Exception(Status.ToString(status));
try
{
return long.Parse(result.GetValue());
}
catch (FormatException)
{
throw new Exception(Status.ToString(Status.KEYSPACE_API_ERROR));
}
}
示例3: TestAndSet
public string TestAndSet(string key, string test, string value)
{
int status = keyspace_client.Keyspace_TestAndSet(cptr, key, test, value);
if (status < 0)
{
result = new Result(keyspace_client.Keyspace_GetResult(cptr));
throw new Exception(Status.ToString(status));
}
if (IsBatched())
return null;
result = new Result(keyspace_client.Keyspace_GetResult(cptr));
return result.GetValue();
}
示例4: Remove
public string Remove(string key)
{
int status = keyspace_client.Keyspace_Remove(cptr, key);
if (status < 0)
{
result = new Result(keyspace_client.Keyspace_GetResult(cptr));
throw new Exception(Status.ToString(status));
}
if (IsBatched())
return null;
result = new Result(keyspace_client.Keyspace_GetResult(cptr));
return result.GetValue();
}
示例5: ListKeyValues
public Dictionary<string, string> ListKeyValues(string prefix, string startKey, ulong count, bool skip, bool forward)
{
int status = keyspace_client.Keyspace_ListKeyValues(cptr, prefix, startKey, count, skip, forward);
result = new Result(keyspace_client.Keyspace_GetResult(cptr));
if (status < 0)
throw new Exception(Status.ToString(status));
Dictionary<string, string> keyValues = new Dictionary<string, string>();
for (result.Begin(); !result.IsEnd(); result.Next())
keyValues.Add(result.GetKey(), result.GetValue());
return keyValues;
}
示例6: Remove
public string Remove(string key)
{
int status = scaliendb_client.SDBP_Delete(cptr, key);
if (status < 0)
{
result = new Result(scaliendb_client.SDBP_GetResult(cptr));
CheckStatus(status);
}
if (IsBatched())
return null;
result = new Result(scaliendb_client.SDBP_GetResult(cptr));
if (result.GetCommandStatus() == Status.SDBP_SUCCESS)
return result.GetValue();
return null;
}
示例7: GetAndSet
public string GetAndSet(string key, string value)
{
int status = scaliendb_client.SDBP_GetAndSet(cptr, key, value);
if (status < 0)
{
result = new Result(scaliendb_client.SDBP_GetResult(cptr));
CheckStatus(status);
}
if (IsBatched())
return null;
result = new Result(scaliendb_client.SDBP_GetResult(cptr));
return result.GetValue();
}