File tree Expand file tree Collapse file tree 13 files changed +13
-13
lines changed
00-get-started/BlazingPizza.Client
01-Components-and-layout/BlazingPizza.Client
02-customize-a-pizza/BlazingPizza.Client
03-show-order-status/BlazingPizza.Client
04-refactor-state-management/BlazingPizza.Client
05-checkout-with-validation/BlazingPizza.Client
06-authentication-and-authorization/BlazingPizza.Client
07-javascript-interop/BlazingPizza.Client
08-templated-components/BlazingPizza.Client
09-progressive-web-app/BlazingPizza.Client Expand file tree Collapse file tree 13 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public static async Task Main(string[] args)
20
20
var builder = WebAssemblyHostBuilder .CreateDefault (args );
21
21
builder .RootComponents .Add <App >(" app" );
22
22
23
- builder .Services .AddTransient (sp => new HttpClient { BaseAddress = new Uri (builder .HostEnvironment .BaseAddress ) });
23
+ builder .Services .AddScoped (sp => new HttpClient { BaseAddress = new Uri (builder .HostEnvironment .BaseAddress ) });
24
24
builder .Services .AddScoped <OrderState >();
25
25
26
26
await builder .Build ().RunAsync ();
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public static async Task Main(string[] args)
51
51
var builder = WebAssemblyHostBuilder .CreateDefault (args );
52
52
builder .RootComponents .Add <App >(" app" );
53
53
54
- builder .Services .AddTransient (sp => new HttpClient { BaseAddress = new Uri (builder .HostEnvironment .BaseAddress ) });
54
+ builder .Services .AddScoped (sp => new HttpClient { BaseAddress = new Uri (builder .HostEnvironment .BaseAddress ) });
55
55
builder .Services .AddScoped <OrderState >();
56
56
57
57
// Add auth services
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static async Task Main(string[] args)
13
13
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
14
14
builder . RootComponents . Add < App > ( "app" ) ;
15
15
16
- builder . Services . AddTransient ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
16
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
17
17
18
18
await builder . Build ( ) . RunAsync ( ) ;
19
19
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static async Task Main(string[] args)
13
13
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
14
14
builder . RootComponents . Add < App > ( "app" ) ;
15
15
16
- builder . Services . AddTransient ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
16
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
17
17
18
18
await builder . Build ( ) . RunAsync ( ) ;
19
19
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static async Task Main(string[] args)
13
13
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
14
14
builder . RootComponents . Add < App > ( "app" ) ;
15
15
16
- builder . Services . AddTransient ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
16
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
17
17
18
18
await builder . Build ( ) . RunAsync ( ) ;
19
19
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static async Task Main(string[] args)
13
13
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
14
14
builder . RootComponents . Add < App > ( "app" ) ;
15
15
16
- builder . Services . AddTransient ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
16
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
17
17
18
18
await builder . Build ( ) . RunAsync ( ) ;
19
19
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static async Task Main(string[] args)
13
13
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
14
14
builder . RootComponents . Add < App > ( "app" ) ;
15
15
16
- builder . Services . AddTransient ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
16
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
17
17
builder . Services . AddScoped < OrderState > ( ) ;
18
18
19
19
await builder . Build ( ) . RunAsync ( ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static async Task Main(string[] args)
13
13
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
14
14
builder . RootComponents . Add < App > ( "app" ) ;
15
15
16
- builder . Services . AddTransient ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
16
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
17
17
builder . Services . AddScoped < OrderState > ( ) ;
18
18
19
19
await builder . Build ( ) . RunAsync ( ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public static async Task Main(string[] args)
14
14
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
15
15
builder . RootComponents . Add < App > ( "app" ) ;
16
16
17
- builder . Services . AddTransient ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
17
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
18
18
builder . Services . AddHttpClient < OrdersClient > ( client => client . BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) )
19
19
. AddHttpMessageHandler < BaseAddressAuthorizationMessageHandler > ( ) ;
20
20
builder . Services . AddScoped < OrderState > ( ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public static async Task Main(string[] args)
14
14
var builder = WebAssemblyHostBuilder . CreateDefault ( args ) ;
15
15
builder . RootComponents . Add < App > ( "app" ) ;
16
16
17
- builder . Services . AddTransient ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
17
+ builder . Services . AddScoped ( sp => new HttpClient { BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) } ) ;
18
18
builder . Services . AddHttpClient < OrdersClient > ( client => client . BaseAddress = new Uri ( builder . HostEnvironment . BaseAddress ) )
19
19
. AddHttpMessageHandler < BaseAddressAuthorizationMessageHandler > ( ) ;
20
20
builder . Services . AddScoped < OrderState > ( ) ;
You can’t perform that action at this time.
0 commit comments