本文整理汇总了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);
}
示例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);
}
示例3: RavenSessionFactory
public RavenSessionFactory(IDocumentStore documentStore)
{
if (_documentStore != null) return;
_documentStore = documentStore;
_documentStore.Initialize();
}
示例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();
}
示例5: Init
public Task Init()
{
_store = new DocumentStore { Url = "http://carter-box:8088", DefaultDatabase = "Ravenhome" };
_store.Initialize();
return Task.FromResult(true);
}
示例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");
}
示例7: InitializeRavenDb
private void InitializeRavenDb()
{
RavenStore = new DocumentStore { ConnectionStringName = "RavenDB" };
RavenStore.Initialize();
// IndexCreation.CreateIndexes(Assembly.GetCallingAssembly(), RavenStore);
}
示例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();
}
示例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();
}
}
示例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();
}
示例11: Initialize
public static void Initialize()
{
instance = new DocumentStore { ConnectionStringName = "Catalog" };
instance.Conventions.IdentityPartsSeparator = "-";
instance.Initialize();
IndexCreation.CreateIndexes(typeof(ProductItems_ByCatalogueId).Assembly, instance);
}
示例12: RavenDbServiceOptions
public RavenDbServiceOptions(string conStringName)
{
_store = new DocumentStore {ConnectionStringName = conStringName};
_store.Initialize();
IndexCreation.CreateIndexes(GetType().Assembly, _store);
}
示例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);
}
示例14: OnSetup
protected override void OnSetup()
{
base.OnSetup();
//Store = new DocumentStore {Url = "http://localhost:8080"};
Store = new EmbeddableDocumentStore { RunInMemory = true };
Store.Initialize();
}
示例15: Initialize
public static IDocumentStore Initialize()
{
instance = new EmbeddableDocumentStore { ConnectionStringName = "RavenDB" };
instance.Conventions.IdentityPartsSeparator = "-";
instance.Initialize();
return instance;
}