本文整理汇总了C#中Raven.Client.Embedded.EmbeddableDocumentStore.OpenAsyncSession方法的典型用法代码示例。如果您正苦于以下问题:C# EmbeddableDocumentStore.OpenAsyncSession方法的具体用法?C# EmbeddableDocumentStore.OpenAsyncSession怎么用?C# EmbeddableDocumentStore.OpenAsyncSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Raven.Client.Embedded.EmbeddableDocumentStore
的用法示例。
在下文中一共展示了EmbeddableDocumentStore.OpenAsyncSession方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
_store = new EmbeddableDocumentStore
{
RunInMemory = true,
DataDirectory = Path.GetTempPath()
};
_store.Initialize();
_session = _store.OpenAsyncSession();
}
示例2: TestInitialize
public void TestInitialize()
{
// Arrange
_documentStore = new EmbeddableDocumentStore
{
ConnectionStringName = "RavenDB"
};
_documentStore.Initialize();
_session = _documentStore.OpenAsyncSession();
_controller = new MoviesController(_session);
}
示例3: Show
public async void Show()
{
using (var store = new EmbeddableDocumentStore
{
RunInMemory = true,
DataDirectory = Path.GetTempPath()
})
{
store.Initialize();
using (var session = store.OpenAsyncSession())
{
var portfolioId = Guid.NewGuid();
await new ConnectedProjector<IAsyncDocumentSession>(Resolve.WhenEqualToHandlerMessageType(Projection.Handlers)).
ProjectAsync(session, new object[]
{
new PortfolioAdded {Id = portfolioId, Name = "My portfolio"},
new PortfolioRenamed {Id = portfolioId, Name = "Your portfolio"},
new PortfolioRemoved {Id = portfolioId}
});
}
}
}