-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 2 additions & 13 deletions
15
src/Abp.Blazor.Server.RadzenUI/Extensions/ApplicationBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
using System.Reflection; | ||
using Abp.RadzenUI.Components; | ||
|
||
namespace Microsoft.AspNetCore.Builder; | ||
namespace Microsoft.AspNetCore.Builder; | ||
|
||
public static class ApplicationBuilderExtensions | ||
{ | ||
public static IApplicationBuilder UseRadzenUI( | ||
this IApplicationBuilder app, | ||
params Assembly[] assemblies | ||
) | ||
public static IApplicationBuilder UseRadzen404Page(this IApplicationBuilder app) | ||
{ | ||
app.UseStatusCodePagesWithRedirects("/404"); | ||
((WebApplication)app) | ||
.MapRazorComponents<App>() | ||
.AddAdditionalAssemblies(assemblies) | ||
.AddInteractiveServerRenderMode(); | ||
|
||
return app; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Abp.Blazor.Server.RadzenUI/Extensions/EndpointRouteBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Abp.RadzenUI; | ||
using Abp.RadzenUI.Components; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Options; | ||
|
||
namespace Microsoft.AspNetCore.Routing; | ||
|
||
public static class EndpointRouteBuilderExtensions | ||
{ | ||
public static RazorComponentsEndpointConventionBuilder MapRadzenUI( | ||
this IEndpointRouteBuilder builder | ||
) | ||
{ | ||
return builder | ||
.MapRazorComponents<App>() | ||
.AddInteractiveServerRenderMode() | ||
.AddAdditionalAssemblies( | ||
[ | ||
.. builder | ||
.ServiceProvider.GetRequiredService<IOptions<AbpRadzenUIOptions>>() | ||
.Value.RouterAdditionalAssemblies, | ||
] | ||
); | ||
} | ||
} |