Skip to content

Commit

Permalink
Remove static files reference and http middleware extension
Browse files Browse the repository at this point in the history
  • Loading branch information
fgilde committed Nov 18, 2024
1 parent 47118cb commit 49087b1
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 80 deletions.
58 changes: 29 additions & 29 deletions MudBlazor.Extensions/Middleware/MudBlazorExtensionsMiddleware.cs
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);
// }
//}
5 changes: 2 additions & 3 deletions MudBlazor.Extensions/MudBlazor.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PropertyGroup>
<MajorVersion>2</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>8</PatchVersion>
<PatchVersion>7.1</PatchVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down Expand Up @@ -70,14 +70,13 @@
<PackageReference Include="ExcelDataReader" Version="3.7.0" />
<PackageReference Include="ExcelDataReader.DataSet" Version="3.7.0" />
<PackageReference Include="AuralizeBlazor" Version="1.1.4" />
<PackageReference Include="MudBlazor.Markdown" Version="7.8.0" />
<PackageReference Include="MudBlazor.Markdown" Version="7.14.0" />
<PackageReference Include="Nextended.Blazor" Version="8.0.12" />
<PackageReference Include="Nextended.Core" Version="8.0.16" />
<PackageReference Include="BlazorJS" Version="2.1.6" />
<PackageReference Include="OneOf" Version="3.0.271" />
<PackageReference Include="Blazored.FluentValidation" Version="2.2.0" />
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
<PackageReference Include="BlazorParameterCastingMagic" Version="1.2.23060811" />
<PackageReference Include="SharpCompress" Version="0.38.0" />
Expand Down
36 changes: 18 additions & 18 deletions MudBlazor.Extensions/MudBlazorExtensionsMiddlewareExtensions.cs
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>();
// }
//}
30 changes: 0 additions & 30 deletions MudBlazor.Extensions/wwwroot/docs/MudBlazor.Extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21835,36 +21835,6 @@
Converts Theme to json
</summary>
</member>
<member name="T:MudBlazor.Extensions.Middleware.MudBlazorExtensionsMiddleware">
<summary>
Middleware for MudBlazor extensions that allows to inject IJSRuntime.
</summary>
</member>
<member name="M:MudBlazor.Extensions.Middleware.MudBlazorExtensionsMiddleware.#ctor(Microsoft.AspNetCore.Http.RequestDelegate)">
<summary>
Initializes a new instance of the <see cref="T:MudBlazor.Extensions.Middleware.MudBlazorExtensionsMiddleware"/> class.
</summary>
<param name="next">The next middleware in the pipeline.</param>
</member>
<member name="M:MudBlazor.Extensions.Middleware.MudBlazorExtensionsMiddleware.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext,Microsoft.JSInterop.IJSRuntime)">
<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>
</member>
<member name="T:MudBlazor.Extensions.MudBlazorExtensionsMiddlewareExtensions">
<summary>
MudBlazorExtensionsMiddlewareExtensions
</summary>
</member>
<member name="M:MudBlazor.Extensions.MudBlazorExtensionsMiddlewareExtensions.UseMudExtensions(Microsoft.AspNetCore.Builder.IApplicationBuilder)">
<summary>
Adds the MudBlazorExtensionsMiddleware
</summary>
<param name="builder"></param>
<returns></returns>
</member>
<member name="T:MudBlazor.Extensions.MudDialogButton">
<summary>
Represents a custom dialog button within a MudBlazor dialog.
Expand Down

0 comments on commit 49087b1

Please sign in to comment.