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


C# IDocumentStore.Initialize方法代码示例

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


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

示例1: SetUp

        public void SetUp()
        {
            _store = NewDocumentStore();
            _store.Initialize();

            // We first have to create the static indexes
            IndexCreation.CreateIndexes(typeof(Player_Index_R03).Assembly, _store);

            _teams = DataGenerator.CreateTeamList();

            // Store some players and teams in the database
            using (var session = _store.OpenSession())
            {
                foreach (var team in _teams)
                {
                    session.Store(team);
                }

                _players = DataGenerator.CreatePlayerListWithTeamIds();

                foreach (var player in _players)
                {
                    session.Store(player);
                }

                session.SaveChanges();
            }

            // Let's wait for indexing to happen
            // this method is part of RavenTestBase and thus should only be used in tests
            WaitForIndexing(_store);
        }
开发者ID:Zuehlke,项目名称:ravendb-workshop,代码行数:32,代码来源:R09_LoadDocumentInIndex.cs

示例2: RavenActionFilter

        static RavenActionFilter()
        {
            DocumentStore = new DocumentStore
            {
                Url = ConfigurationManager.AppSettings["RavenServerUrl"],
                DefaultDatabase = ConfigurationManager.AppSettings["RavenDatabase"],
                Credentials = new NetworkCredential(
                    ConfigurationManager.AppSettings["RavenUser"],
                    ConfigurationManager.AppSettings["RavenPassword"]),
                Conventions =
                {
                    FindTypeTagName = type =>
                    {
                        if (typeof(Recruiter).IsAssignableFrom(type) || typeof(ClientUser).IsAssignableFrom(type) || typeof(Candidate).IsAssignableFrom(type))
                            return "Users";

                        return DocumentConvention.DefaultTypeTagName(type);
                    }
                }
            }.RegisterListener(new AuditListener());

            DocumentStore.Initialize();
            DocumentStore.Conventions.SaveEnumsAsIntegers = true;

            IndexCreation.CreateIndexes(typeof(ClientSearchIndex).Assembly, DocumentStore);
            RavenProfiler.InitializeFor(DocumentStore);
        }
开发者ID:gan123,项目名称:Right-Recruit,代码行数:27,代码来源:RavenActionFilter.cs

示例3: RavenSessionFactory

        public RavenSessionFactory(IDocumentStore documentStore)
        {
            if (_documentStore != null) return;

            _documentStore = documentStore;
            _documentStore.Initialize();
        }
开发者ID:adrianrussell,项目名称:MVC3-POC,代码行数:7,代码来源:RavenSessionFactory.cs

示例4: Initialize

 private void Initialize()
 {
     DocumentStore = new DocumentStore {Url = $"{Url}:{Port}", DefaultDatabase = DefaultDatabase};
     DocumentStore.Conventions.FindTypeTagName =
         t => t == typeof (Sephira) ? "Sephiroth" : Inflector.Pluralize(t.Name);
     DocumentStore.Initialize();
 }
开发者ID:avanderbilt,项目名称:TreeOfLife,代码行数:7,代码来源:TreeOfLifeDatabase.cs

示例5: Init

 public Task Init()
 {
     _store = new DocumentStore { Url = "http://carter-box:8088", DefaultDatabase = "Ravenhome" };
     _store.Initialize();
     
     return Task.FromResult(true);
 }
开发者ID:GeneralCarter,项目名称:Ravenhome,代码行数:7,代码来源:RavenDBService.cs

示例6: RavenDocStore

 public RavenDocStore()
 {
     _documentStore = new DocumentStore { Url = ConfigurationManager.AppSettings["RAVENHQ_CONNECTION_STRING"], DefaultDatabase = "SmsTracking" };
     _documentStore.Initialize();
     _documentStore.DatabaseCommands.EnsureDatabaseExists("Configuration");
     _documentStore.DatabaseCommands.EnsureDatabaseExists("SmsTracking");
 }
开发者ID:kevinhillinger,项目名称:SmsScheduler,代码行数:7,代码来源:RavenDocStore.cs

示例7: InitializeRavenDb

        private void InitializeRavenDb()
        {
            RavenStore = new DocumentStore { ConnectionStringName = "RavenDB" };
            RavenStore.Initialize();

            // IndexCreation.CreateIndexes(Assembly.GetCallingAssembly(), RavenStore);
        }
开发者ID:hombredequeso,项目名称:Power-Analysis,代码行数:7,代码来源:Global.asax.cs

示例8: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            Store = new DocumentStore{ConnectionStringName = "RavenDB", DefaultDatabase = "Products"};
            Store.Initialize();

            Raven.Client.MvcIntegration.RavenProfiler.InitializeFor(Store);
            MvcMiniProfiler.RavenDb.Profiler.AttachTo((DocumentStore)Store);

            //Move this to a config file later
            Mapper.CreateMap<Product, ProductViewModel>()
               .ForMember(x => x.Id, o => o.MapFrom(m => m.Id))
               .ForMember(x => x.CategoryId, o => o.MapFrom(m => m.CategoryId))
               .ForMember(x => x.SupplierId, o => o.MapFrom(m => m.SupplierId))
               .ForMember(x => x.Name, o => o.MapFrom(m => m.Name))
               .ForMember(x => x.Code, o => o.MapFrom(m => m.Code))
               .ForMember(x => x.StandardCost, o => o.MapFrom(m => m.StandardCost))
               .ForMember(x => x.ListPrice, o => o.MapFrom(m => m.ListPrice))
               .ForMember(x => x.UnitsOnStock, o => o.MapFrom(m => m.UnitsOnStock))
               .ForMember(x => x.UnitsOnOrder, o => o.MapFrom(m => m.UnitsOnOrder))
               .ForMember(x => x.Discontinued, o => o.MapFrom(m => m.Discontinued));

            TryCreatingIndexesOrRedirectToErrorPage();
        }
开发者ID:gsuttie,项目名称:RavenMVCProducts,代码行数:28,代码来源:Global.asax.cs

示例9: Initialize

        public override void Initialize(string name, NameValueCollection config)
        {
            if (config == null)
                throw new ArgumentNullException("config");

            _providerName = name;

            base.Initialize(name, config);

            SetConfigurationProperties(config);

            if (_documentStore == null)
            {
                if (string.IsNullOrEmpty(config["connectionStringName"]))
                    throw new ConfigurationErrorsException("Must supply a connectionStringName.");

                _documentStore = new DocumentStore
                {
                    ConnectionStringName = config["connectionStringName"],
                };

                _documentStore.Initialize();
            }

            if (_documentStore.DatabaseCommands.GetIndex("Users/ByApplicationNameAndRoleName") == null)
            {
                CreateRavenDbIndexes();
            }
        }
开发者ID:tjmkruger,项目名称:Raven.AspNetProviders,代码行数:29,代码来源:RavenRoleProvider.cs

示例10: InitialiseTest

        public void InitialiseTest()
        {
            documentStore = new EmbeddableDocumentStore
            {
                RunInMemory = true
            };
            documentStore.Initialize();

            session = documentStore.OpenSession();
            var user1 = new User
            {
                FullName = "FullName1",
                Username = "Username1",
                Password = "Password1",
            };
            session.Store(user1);

            var user2 = new User
            {
                FullName = "FullName2",
                Username = "Username2",
                Password = "Password2",
            };
            session.Store(user2);
            session.SaveChanges();
        }
开发者ID:emanuelgidar,项目名称:RecipesMVC4,代码行数:26,代码来源:AccountControllerTests.cs

示例11: Initialize

 public static void Initialize()
 {
     instance = new DocumentStore { ConnectionStringName = "Catalog" };
     instance.Conventions.IdentityPartsSeparator = "-";
     instance.Initialize();            
     IndexCreation.CreateIndexes(typeof(ProductItems_ByCatalogueId).Assembly, instance);
 }
开发者ID:themarcuz,项目名称:XlnsCatalog,代码行数:7,代码来源:DataDocumentStore.cs

示例12: RavenDbServiceOptions

        public RavenDbServiceOptions(string conStringName)
        {
            _store = new DocumentStore {ConnectionStringName = conStringName};
            _store.Initialize();

            IndexCreation.CreateIndexes(GetType().Assembly, _store);
        }
开发者ID:Agrando,项目名称:IdentityServer.Contrib.RavenDB,代码行数:7,代码来源:RavenDbServiceOptions.cs

示例13: RavenDocStore

 public RavenDocStore()
 {
     _documentStore = new DocumentStore { Url = "http://localhost:8080", ResourceManagerId = Guid.NewGuid() };
     _documentStore.Initialize();
     _documentStore.DatabaseCommands.EnsureDatabaseExists("Configuration");
     IndexCreation.CreateIndexes(typeof(ScheduleMessagesInCoordinatorIndex).Assembly, _documentStore);
 }
开发者ID:Compassion,项目名称:SmsScheduler,代码行数:7,代码来源:RavenDocStore.cs

示例14: OnSetup

 protected override void OnSetup()
 {
     base.OnSetup();
     //Store = new DocumentStore {Url = "http://localhost:8080"};
     Store = new EmbeddableDocumentStore { RunInMemory = true };
     Store.Initialize();
 }
开发者ID:divyang4481,项目名称:REM,代码行数:7,代码来源:InitializeTestDataToRavenDbTests.cs

示例15: Initialize

 public static IDocumentStore Initialize()
 {
     instance = new EmbeddableDocumentStore { ConnectionStringName = "RavenDB" };
     instance.Conventions.IdentityPartsSeparator = "-";
     instance.Initialize();
     return instance;
 }
开发者ID:ajpasco,项目名称:SimpleBlog_MVC4-example,代码行数:7,代码来源:DataDocumentStore.cs


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