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


C# EmbeddableDocumentStore.ExecuteIndex方法代码示例

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


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

示例1: Create

        public ITimeoutManager Create()
        {
            _documentStore = new EmbeddableDocumentStore()
            {
                RunInMemory = true,
            };

            _documentStore.Configuration.Storage.Voron.AllowOn32Bits = true;

            _documentStore.Initialize();
            _documentStore.ExecuteIndex(new TimeoutIndex());

            return new RavenDbTimeoutManager(_documentStore, new ConsoleLoggerFactory(false));
        }
开发者ID:RichieYang,项目名称:Rebus,代码行数:14,代码来源:RavenDbTimoutManagerFactory.cs

示例2: ConfigureRaven

        public static void ConfigureRaven(MvcApplication application)
        {
            var store = new EmbeddableDocumentStore
                                {
                                    DataDirectory = "~/App_Data/Database",
                                    UseEmbeddedHttpServer = true
                                };

            store.Conventions.CustomizeJsonSerializer = x => x.Converters.Add(new GeoJsonConverter());
            store.Initialize();
            MvcApplication.DocumentStore = store;

            store.ExecuteIndex(new RestaurantIndex());
            store.ExecuteTransformer(new RestaurantsTransformer());

            var statistics = store.DatabaseCommands.GetStatistics();

            if (statistics.CountOfDocuments < 5)
                using (var bulkInsert = store.BulkInsert())
                    LoadRestaurants(application.Server.MapPath("~/App_Data/Restaurants.csv"), bulkInsert);
        }
开发者ID:sibartlett,项目名称:RavenBurgerCo,代码行数:21,代码来源:RavenConfig.cs

示例3: Init

        public void Init()
        {
            Directory.CreateDirectory(Settings.DbPath);

            var documentStore = new EmbeddableDocumentStore
            {
                DataDirectory = Settings.DbPath,
                UseEmbeddedHttpServer = Settings.MaintenanceMode || Settings.ExposeRavenDB,
                EnlistInDistributedTransactions = false,
            };

            var localRavenLicense = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "RavenLicense.xml");
            if (File.Exists(localRavenLicense))
            {
                Logger.InfoFormat("Loading RavenDB license found from {0}", localRavenLicense);
                documentStore.Configuration.Settings["Raven/License"] = NonLockingFileReader.ReadAllTextWithoutLocking(localRavenLicense);
            }
            else
            {
                Logger.InfoFormat("Loading Embedded RavenDB license");
                documentStore.Configuration.Settings["Raven/License"] = ReadLicense();
            }

            documentStore.Configuration.Catalog.Catalogs.Add(new AssemblyCatalog(GetType().Assembly));

            if (!Settings.MaintenanceMode) {
                documentStore.Configuration.Settings.Add("Raven/ActiveBundles", "CustomDocumentExpiration");
            }

            documentStore.Configuration.Port = Settings.Port;
            documentStore.Configuration.HostName = (Settings.Hostname == "*" || Settings.Hostname == "+")
                ? "localhost"
                : Settings.Hostname;
            documentStore.Configuration.CompiledIndexCacheDirectory = Settings.DbPath;
            documentStore.Configuration.VirtualDirectory = Settings.VirtualDirectory + "/storage";
            documentStore.Conventions.SaveEnumsAsIntegers = true;
            documentStore.Initialize();

            Logger.Info("Index creation started");

            //Create this index synchronously as we are using it straight away
            //Should be quick as number of endpoints will always be a small number
            documentStore.ExecuteIndex(new KnownEndpointIndex());

            if (Settings.CreateIndexSync)
            {
                IndexCreation.CreateIndexes(typeof(RavenBootstrapper).Assembly, documentStore);
            }
            else
            {
                IndexCreation.CreateIndexesAsync(typeof(RavenBootstrapper).Assembly, documentStore)
                    .ContinueWith(c =>
                    {
                        if (c.IsFaulted)
                        {
                            Logger.Error("Index creation failed", c.Exception);
                        }
                    });
            }

            PurgeKnownEndpointsWithTemporaryIdsThatAreDuplicate(documentStore);

            Configure.Instance.Configurer.RegisterSingleton<IDocumentStore>(documentStore);
            Configure.Component(builder =>
            {
            #pragma warning disable 618
                var context = builder.Build<PipelineExecutor>().CurrentContext;
            #pragma warning restore 618

                IDocumentSession session;

                if (context.TryGet(out session))
                {
                    return session;
                }

                throw new InvalidOperationException("No session available");
            }, DependencyLifecycle.InstancePerCall);

            Configure.Instance.RavenDBStorageWithSelfManagedSession(documentStore, false,
                () => Configure.Instance.Builder.Build<IDocumentSession>())
                .UseRavenDBSagaStorage()
                .UseRavenDBSubscriptionStorage()
                .UseRavenDBTimeoutStorage();
        }
开发者ID:AlexRhees,项目名称:ServiceControl,代码行数:85,代码来源:RavenBootstrapper.cs


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