-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove static files reference and http middleware extension
- Loading branch information
Showing
4 changed files
with
49 additions
and
80 deletions.
There are no files selected for viewing
58 changes: 29 additions & 29 deletions
58
MudBlazor.Extensions/Middleware/MudBlazorExtensionsMiddleware.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,33 +1,33 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.JSInterop; | ||
using MudBlazor.Extensions.Helper; | ||
//using Microsoft.AspNetCore.Http; | ||
//using Microsoft.JSInterop; | ||
//using MudBlazor.Extensions.Helper; | ||
|
||
namespace MudBlazor.Extensions.Middleware; | ||
//namespace MudBlazor.Extensions.Middleware; | ||
|
||
/// <summary> | ||
/// Middleware for MudBlazor extensions that allows to inject IJSRuntime. | ||
/// </summary> | ||
public class MudBlazorExtensionsMiddleware | ||
{ | ||
private readonly RequestDelegate _next; | ||
///// <summary> | ||
///// Middleware for MudBlazor extensions that allows to inject IJSRuntime. | ||
///// </summary> | ||
//public class MudBlazorExtensionsMiddleware | ||
//{ | ||
// private readonly RequestDelegate _next; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MudBlazorExtensionsMiddleware"/> class. | ||
/// </summary> | ||
/// <param name="next">The next middleware in the pipeline.</param> | ||
public MudBlazorExtensionsMiddleware(RequestDelegate next) | ||
{ | ||
_next = next; | ||
} | ||
// /// <summary> | ||
// /// Initializes a new instance of the <see cref="MudBlazorExtensionsMiddleware"/> class. | ||
// /// </summary> | ||
// /// <param name="next">The next middleware in the pipeline.</param> | ||
// public MudBlazorExtensionsMiddleware(RequestDelegate next) | ||
// { | ||
// _next = next; | ||
// } | ||
|
||
/// <summary> | ||
/// Method invoked by the pipeline. Injects IJSRuntime into JsImportHelper and then passes control to the next middleware in the pipeline. | ||
/// </summary> | ||
/// <param name="context">The HttpContext for the current request.</param> | ||
/// <param name="jsRuntime">The IJSRuntime instance for the current request.</param> | ||
public async Task InvokeAsync(HttpContext context, IJSRuntime jsRuntime) | ||
{ | ||
JsImportHelper.LegacyRuntimeReference = jsRuntime; | ||
await _next(context); | ||
} | ||
} | ||
// /// <summary> | ||
// /// Method invoked by the pipeline. Injects IJSRuntime into JsImportHelper and then passes control to the next middleware in the pipeline. | ||
// /// </summary> | ||
// /// <param name="context">The HttpContext for the current request.</param> | ||
// /// <param name="jsRuntime">The IJSRuntime instance for the current request.</param> | ||
// public async Task InvokeAsync(HttpContext context, IJSRuntime jsRuntime) | ||
// { | ||
// JsImportHelper.LegacyRuntimeReference = jsRuntime; | ||
// await _next(context); | ||
// } | ||
//} |
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
36 changes: 18 additions & 18 deletions
36
MudBlazor.Extensions/MudBlazorExtensionsMiddlewareExtensions.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,20 +1,20 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using MudBlazor.Extensions.Middleware; | ||
//using Microsoft.AspNetCore.Builder; | ||
//using MudBlazor.Extensions.Middleware; | ||
|
||
namespace MudBlazor.Extensions; | ||
//namespace MudBlazor.Extensions; | ||
|
||
/// <summary> | ||
/// MudBlazorExtensionsMiddlewareExtensions | ||
/// </summary> | ||
public static class MudBlazorExtensionsMiddlewareExtensions | ||
{ | ||
/// <summary> | ||
/// Adds the MudBlazorExtensionsMiddleware | ||
/// </summary> | ||
/// <param name="builder"></param> | ||
/// <returns></returns> | ||
public static IApplicationBuilder UseMudExtensions(this IApplicationBuilder builder) | ||
{ | ||
return builder.UseMiddleware<MudBlazorExtensionsMiddleware>(); | ||
} | ||
} | ||
///// <summary> | ||
///// MudBlazorExtensionsMiddlewareExtensions | ||
///// </summary> | ||
//public static class MudBlazorExtensionsMiddlewareExtensions | ||
//{ | ||
// /// <summary> | ||
// /// Adds the MudBlazorExtensionsMiddleware | ||
// /// </summary> | ||
// /// <param name="builder"></param> | ||
// /// <returns></returns> | ||
// public static IApplicationBuilder UseMudExtensions(this IApplicationBuilder builder) | ||
// { | ||
// return builder.UseMiddleware<MudBlazorExtensionsMiddleware>(); | ||
// } | ||
//} |
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