-
-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update sample projects & samples in docs (#2823)
* update them all * more docs * moar docs
- Loading branch information
Showing
31 changed files
with
695 additions
and
769 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
public class Program | ||
{ | ||
private readonly IServiceProvider _serviceProvider; | ||
|
||
public Program() | ||
{ | ||
_serviceProvider = CreateProvider(); | ||
} | ||
|
||
static void Main(string[] args) | ||
=> new Program().RunAsync(args).GetAwaiter().GetResult(); | ||
|
||
private static IServiceProvider _serviceProvider; | ||
|
||
static IServiceProvider CreateProvider() | ||
{ | ||
var collection = new ServiceCollection(); | ||
//... | ||
return collection.BuildServiceProvider(); | ||
} | ||
|
||
async Task RunAsync(string[] args) | ||
static async Task Main(string[] args) | ||
{ | ||
//... | ||
_serviceProvider = CreateProvider(); | ||
} | ||
} |
4 changes: 1 addition & 3 deletions
4
docs/guides/getting_started/samples/first-bot/async-context.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
public class Program | ||
{ | ||
public static Task Main(string[] args) => new Program().MainAsync(); | ||
|
||
public async Task MainAsync() | ||
public static async Task Main() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.