8
8
using Microsoft . AspNetCore . Builder ;
9
9
using Microsoft . AspNetCore . Components ;
10
10
using Microsoft . AspNetCore . Components . Endpoints ;
11
- using Microsoft . AspNetCore . Components . Forms . Mapping ;
12
11
using Microsoft . AspNetCore . Components . Routing ;
13
- using Microsoft . AspNetCore . Components . Web ;
14
12
using Microsoft . AspNetCore . Http ;
15
13
using Microsoft . AspNetCore . Routing ;
16
14
using Microsoft . Extensions . DependencyInjection . Extensions ;
17
15
using Microsoft . Extensions . Hosting ;
18
16
using Microsoft . Extensions . Options ;
19
17
18
+ #pragma warning disable IDE0130
20
19
namespace Microsoft . Extensions . DependencyInjection ;
20
+ #pragma warning restore IDE0130
21
21
22
22
/// <summary>
23
23
/// This class has extension methods for <see cref="IHostApplicationBuilder"/> and <see cref="IApplicationBuilder"/>
@@ -48,7 +48,7 @@ public static IRazorComponentsBuilder AddHtmx(this IRazorComponentsBuilder razor
48
48
services . AddScoped < IRazorComponentEndpointInvoker > ( x => x . GetRequiredService < IHtmxorComponentEndpointInvoker > ( ) ) ;
49
49
50
50
services . Remove ( services . Single ( x => x . Lifetime is ServiceLifetime . Scoped && x . ServiceType . FullName ? . Equals ( "Microsoft.AspNetCore.Components.Endpoints.EndpointHtmlRenderer" ) == true ) ) ;
51
- services . AddScoped < EndpointHtmxorRenderer > ( ) ;
51
+ services . AddScoped < HtmxorRenderer > ( ) ;
52
52
53
53
// Adding the same cascading value does not seem to override existing values added previously.
54
54
// Instead, the previous value is still used. Is this expected behavior or a bug?
@@ -59,8 +59,8 @@ public static IRazorComponentsBuilder AddHtmx(this IRazorComponentsBuilder razor
59
59
. Single ( x => x . ImplementationFactory ? . Target ? . ToString ( ) ? . Contains ( typeof ( HttpContext ) . FullName ! ) == true ) ;
60
60
services . Remove ( existingCascadingHttpContextProvider ) ;
61
61
62
- services . AddCascadingValue ( sp => sp . GetRequiredService < EndpointHtmxorRenderer > ( ) . HttpContext ) ;
63
- services . AddScoped ( sp => sp . GetRequiredService < EndpointHtmxorRenderer > ( ) . HttpContext ! ) ;
62
+ services . AddCascadingValue ( sp => sp . GetRequiredService < HtmxorRenderer > ( ) . HttpContext ) ;
63
+ services . AddScoped ( sp => sp . GetRequiredService < HtmxorRenderer > ( ) . HttpContext ! ) ;
64
64
65
65
services . Remove ( services . Single ( x => x . ServiceType == typeof ( NavigationManager ) ) ) ;
66
66
services . AddScoped < NavigationManager , HtmxorNavigationManager > ( ) ;
@@ -75,7 +75,7 @@ public static IRazorComponentsBuilder AddHtmx(this IRazorComponentsBuilder razor
75
75
configurHtmx ? . Invoke ( config ) ;
76
76
return config ;
77
77
} ) ;
78
- services . AddScoped ( srv => srv . GetRequiredService < EndpointHtmxorRenderer > ( ) . HttpContext ! . GetHtmxContext ( ) ) ;
78
+ services . AddScoped ( srv => srv . GetRequiredService < HtmxorRenderer > ( ) . HttpContext ! . GetHtmxContext ( ) ) ;
79
79
services . AddCascadingValue ( sp => sp . GetRequiredService < HtmxContext > ( ) ) ;
80
80
81
81
return razorComponentsBuilder ;
0 commit comments