本文整理汇总了C#中IDatabaseCommands.Put方法的典型用法代码示例。如果您正苦于以下问题:C# IDatabaseCommands.Put方法的具体用法?C# IDatabaseCommands.Put怎么用?C# IDatabaseCommands.Put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDatabaseCommands
的用法示例。
在下文中一共展示了IDatabaseCommands.Put方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AfterExecute
internal static void AfterExecute(IDatabaseCommands databaseCommands, string indexName, ScriptedIndexResults scripts)
{
var documentId = GetScriptedIndexResultsDocumentId(indexName);
scripts.Id = documentId;
var oldDocument = databaseCommands.Get(documentId);
var newDocument = RavenJObject.FromObject(scripts);
if (oldDocument != null && RavenJToken.DeepEquals(oldDocument.DataAsJson, newDocument))
return;
databaseCommands.Put(documentId, null, newDocument, null);
databaseCommands.ResetIndex(indexName);
}
示例2: PutDocument
private void PutDocument(IDatabaseCommands databaseCommands,JsonDocument document)
{
databaseCommands.Put(HiLoDocumentKey, document.Etag,
document.DataAsJson,
document.Metadata);
}
示例3: SetupReplication
private static void SetupReplication(IDatabaseCommands source, params string[] urls)
{
source.Put(Constants.RavenReplicationDestinations,
null, new RavenJObject
{
{
"Destinations", new RavenJArray(urls.Select(url => new RavenJObject
{
{"Url", url}
}))
}
}, new RavenJObject());
}
示例4: InvokePut
static bool InvokePut(IDatabaseCommands systemCommands, RavenJObject ravenJObject)
{
try
{
systemCommands.Put("Raven/Authorization/WindowsSettings", null, ravenJObject, new RavenJObject());
return true;
}
catch (ErrorResponseException exception)
{
if (exception.Message.Contains("Cannot setup Windows Authentication without a valid commercial license."))
{
throw new Exception("RavenDB requires a Commercial license to configure windows authentication. Please either install your RavenDB license or contact [email protected] if you need a copy of the RavenDB license.");
}
throw;
}
}