本文整理汇总了C#中IAsyncDocumentSession.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# IAsyncDocumentSession.Delete方法的具体用法?C# IAsyncDocumentSession.Delete怎么用?C# IAsyncDocumentSession.Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAsyncDocumentSession
的用法示例。
在下文中一共展示了IAsyncDocumentSession.Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteCorrelationProperties
async Task DeleteCorrelationProperties(IEnumerable<string> correlationPropertyIds, IAsyncDocumentSession session)
{
var existingSagaCorrelationPropertyDocuments =
await session.LoadAsync<SagaCorrelationPropertyDocument>(
correlationPropertyIds);
//delete the existing saga correlation documents
foreach (var existingSagaCorrelationPropertyDocument in existingSagaCorrelationPropertyDocuments)
{
session.Delete(existingSagaCorrelationPropertyDocument);
}
}
示例2: DeletedPosts
private static async Task DeletedPosts(IAsyncDocumentSession session, IEnumerable<BlogPostBase> deletedPosts)
{
foreach (var deletedPost in deletedPosts)
{
string postId = RavenDbIdConventions.GetBlogPostId(deletedPost.BlogKey, deletedPost.BlavenId);
var existingPost = await session.LoadAsync<BlogPost>(postId);
if (existingPost != null)
{
session.Delete(existingPost);
}
}
}
示例3: DeleteCorrelationPropertyDataForSaga
private async Task DeleteCorrelationPropertyDataForSaga(SagaDataDocument sagaDataDocument,
IAsyncDocumentSession session)
{
var existingSagaCorrelationPropertyDocuments =
await session.LoadAsync<SagaCorrelationPropertyDocument>(
sagaDataDocument.SagaCorrelationPropertyDocumentIds);
//delete the existing saga correlation documents
foreach (var existingSagaCorrelationPropertyDocument in existingSagaCorrelationPropertyDocuments)
{
session.Delete(existingSagaCorrelationPropertyDocument);
}
}