File tree Expand file tree Collapse file tree 4 files changed +9
-11
lines changed
TaskHub.Shared.Bootstraper Expand file tree Collapse file tree 4 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 44 <ImplicitUsings >enable</ImplicitUsings >
55 <Nullable >enable</Nullable >
66 <IsPackable >true</IsPackable >
7- <Version >2.1.13 </Version >
7+ <Version >2.1.14 </Version >
88 <Authors >Andrey Serdyuk</Authors >
99 <Company >TaskHub</Company >
1010 <PackageTags >#TaskHub</PackageTags >
Original file line number Diff line number Diff line change 11<Solution >
22 <Folder Name =" /.solution_items/" >
33 <File Path =" Directory.Build.props" />
4- <File Path =" Directory.Packages.props" />
54 </Folder >
65 <Folder Name =" /.solution_items/.nuget/" >
76 <File Path =" .nuget/delist.ps1" />
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class BasicHostBuilder(string[] args)
99{
1010 private readonly WebApplicationBuilder Builder = WebApplication . CreateBuilder ( args ) ;
1111
12- public BasicHostBuilder Init ( Action < WebApplicationBuilder > action )
12+ public void Init ( Action < WebApplicationBuilder > action )
1313 {
1414 Builder . Services . AddControllers ( ) . AddJsonOptions ( o => o . JsonSerializerOptions . PropertyNameCaseInsensitive = true ) ;
1515 Builder . Services . AddEndpointsApiExplorer ( ) ;
@@ -19,10 +19,9 @@ public BasicHostBuilder Init(Action<WebApplicationBuilder> action)
1919 Builder . Services . AddHttpContextAccessor ( ) ;
2020 Builder . Services . ConfigureHttpJsonOptions ( o => o . SerializerOptions . NumberHandling = JsonNumberHandling . AllowNamedFloatingPointLiterals ) ;
2121 action ( Builder ) ;
22- return this ;
2322 }
2423
25- public async Task < BasicHostBuilder > Run ( Action < WebApplication > action )
24+ public async Task Run ( Func < WebApplication , Task > action )
2625 {
2726 var app = Builder . Build ( ) ;
2827
@@ -34,8 +33,7 @@ public async Task<BasicHostBuilder> Run(Action<WebApplication> action)
3433 app . UseHttpsRedirection ( ) ;
3534 app . UseAuthentication ( ) ;
3635 app . UseAuthorization ( ) ;
37- action ( app ) ;
36+ await action ( app ) ;
3837 await app . RunAsync ( ) ;
39- return this ;
4038 }
4139}
Original file line number Diff line number Diff line change @@ -33,10 +33,11 @@ public FullHostBuilder Use(Action<WebApplication> act)
3333
3434 public async Task StartWith < TContext > ( Action < HostOptions > action ) where TContext : DbContext
3535 {
36- var options = new HostOptions ( ) ;
37- action ( options ) ;
38- var builder = new BasicHostBuilder ( args ) . Init ( builder =>
36+ var host = new BasicHostBuilder ( args ) ;
37+ host . Init ( builder =>
3938 {
39+ var options = new HostOptions ( ) ;
40+ action ( options ) ;
4041 builder . Services . AddScoped < ICommandsBus , CommandsBus > ( ) ;
4142 builder . Services . AddAppDbContext < TContext > ( builder . Configuration , o => o . ConnectionString = options . ConnectionString ) ;
4243 builder . AddAppAuthentication ( ) ;
@@ -52,7 +53,7 @@ public async Task StartWith<TContext>(Action<HostOptions> action) where TContext
5253 _initAct ( builder ) ;
5354 } ) ;
5455
55- await builder . Run ( async app =>
56+ await host . Run ( async app =>
5657 {
5758 app . UseOpenTelemetryPrometheusScrapingEndpoint ( ) ;
5859 await app . Services . MigrateAsync < TContext > ( ) ;
You can’t perform that action at this time.
0 commit comments