本文整理汇总了C#中Slide.BulletPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Slide.BulletPoint方法的具体用法?C# Slide.BulletPoint怎么用?C# Slide.BulletPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slide
的用法示例。
在下文中一共展示了Slide.BulletPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransactionScopeIntroOrRefresh
public async Task TransactionScopeIntroOrRefresh()
{
var slide = new Slide(title: "Transaction Scope Intro");
await slide
.BulletPoint("System.Transactions.TransactionScope")
.BulletPoint("Implicit programing model / Ambient Transactions")
.BulletPoint("Only works with async/await in .NET 4.5.1")
.BulletPoint("Limited usefulness in cloud scenarios")
.BulletPoint("Upgrades a local transaction to a distributed transaction")
.BulletPoint("Ease of coding - If you prefer implicit over explicit")
.Sample(() =>
{
Assert.Null(Transaction.Current);
using (var tx = new TransactionScope())
{
Assert.NotNull(Transaction.Current);
SomeMethodInTheCallStack();
tx.Complete();
}
Assert.Null(Transaction.Current);
});
}
示例2: WhatDidWeJustLearn
public async Task WhatDidWeJustLearn()
{
var slide = new Slide(title: "What did we just learn?");
await slide
.BulletPoint("Async void is evil! Use carefully.")
.BulletPoint("Async all the way.")
.BulletPoint("In a cloud first and async world try to avoid TransactionScope")
.BulletPoint("Modern frameworks like EF6 (and higher) support own transactions")
.BulletPoint("Use AsyncPump if you need TxScope and enlist your own stuff.")
.BulletPoint("Write an async enabled library? ConfigureAwait(false) is your friend");
}
示例3: Links
public async Task Links()
{
var slide = new Slide(title: "Useful links");
await slide
.BulletPoint("Sample Code including Transcript of what I explained" +
"https://github.com/danielmarbach/AsyncTransactions")
.BulletPoint("Six Essential Tips for Async - " +
"http://channel9.msdn.com/Series/Three-Essential-Tips-for-Async")
.BulletPoint("Best Practices in Asynchronous Programming" +
"https://msdn.microsoft.com/en-us/magazine/jj991977.aspx")
.BulletPoint("Participating in TransactionScopes and Async/Await" +
"http://www.planetgeek.ch/2014/12/07/participating-in-transactionscopes-and-asyncawait-introduction/")
.BulletPoint("Working with Transactions (EF6 Onwards)" +
"https://msdn.microsoft.com/en-us/data/dn456843.aspx")
.BulletPoint("Enlisting Resources as Participants in a Transaction" +
"https://msdn.microsoft.com/en-us/library/ms172153.aspx");
}
示例4: StoreAsync
public async Task StoreAsync(DatabaseMode mode)
{
var slide = new Slide(title: "Store Async");
await slide
.BulletPoint("OMG! You just rolled your own NoSQL database, right?")
.Sample(async () =>
{
var database = new Database("StoreAsync.received.txt", mode);
StoringTenSwissGuysInTheDatabase(database);
try
{
await database.SaveAsync().ConfigureAwait(false);
}
finally
{
database.Close();
}
});
}