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


C# IDatabaseCommands.Put方法代码示例

本文整理汇总了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);
        }
开发者ID:j2jensen,项目名称:ravendb,代码行数:13,代码来源:AbstractScriptedIndexCreationTask.cs

示例2: PutDocument

		private void PutDocument(IDatabaseCommands databaseCommands,JsonDocument document)
		{
			databaseCommands.Put(HiLoDocumentKey, document.Etag,
								 document.DataAsJson,
								 document.Metadata);
		}
开发者ID:samueldjack,项目名称:ravendb,代码行数:6,代码来源:HiLoKeyGenerator.cs

示例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());
		}
开发者ID:AleksanderGondek,项目名称:GUT_IronTester,代码行数:13,代码来源:Program.cs

示例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;
     }
 }
开发者ID:hanin,项目名称:NServiceBus.RavenDB,代码行数:16,代码来源:RavenUserInstaller.cs


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