File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed
src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Threading . Tasks ;
51using Microsoft . Extensions . DependencyInjection ;
62using Microsoft . Extensions . Hosting ;
3+ using Company . Application1 ;
74
8- namespace Company . Application1
9- {
10- public class Program
5+ IHost host = Host . CreateDefaultBuilder ( args )
6+ . ConfigureServices ( services =>
117 {
12- public static void Main ( string [ ] args )
13- {
14- CreateHostBuilder ( args ) . Build ( ) . Run ( ) ;
15- }
8+ services . AddHostedService < Worker > ( ) ;
9+ } )
10+ . Build ( ) ;
1611
17- public static IHostBuilder CreateHostBuilder ( string [ ] args ) =>
18- Host . CreateDefaultBuilder ( args )
19- . ConfigureServices ( ( hostContext , services ) =>
20- {
21- services . AddHostedService < Worker > ( ) ;
22- } ) ;
23- }
24- }
12+ await host . RunAsync ( ) ;
You can’t perform that action at this time.
0 commit comments