File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Net . Http ;
3
- using System . Collections . Generic ;
4
3
using System . Threading . Tasks ;
5
- using System . Text ;
6
4
using Microsoft . AspNetCore . Components . WebAssembly . Hosting ;
7
- using Microsoft . Extensions . Configuration ;
8
5
using Microsoft . Extensions . DependencyInjection ;
9
- using Microsoft . Extensions . Logging ;
10
6
11
7
namespace BlazorApp . Client
12
8
{
@@ -18,9 +14,7 @@ public static async Task Main(string[] args)
18
14
builder . RootComponents . Add < App > ( "app" ) ;
19
15
20
16
var baseAddress = builder . Configuration [ "BaseAddress" ] ?? builder . HostEnvironment . BaseAddress ;
21
- builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( baseAddress ) } ) ;
22
-
23
- //builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
17
+ builder . Services . AddScoped ( _ => new HttpClient { BaseAddress = new Uri ( baseAddress ) } ) ;
24
18
25
19
await builder . Build ( ) . RunAsync ( ) ;
26
20
}
You can’t perform that action at this time.
0 commit comments