Got at least one data fetching method working; turns out, we can't use a patched LogicStack to get the data

This commit is contained in:
2026-01-14 22:11:11 +01:00
parent 40a8431464
commit 3f7122d30a
350 changed files with 41444 additions and 119 deletions

View File

@@ -0,0 +1,30 @@
using System;
namespace EmbedIO.Routing
{
/// <summary>
/// Handles a HTTP request by matching it against a route,
/// possibly handling different HTTP methods via different handlers.
/// </summary>
public sealed class RouteVerbResolver : RouteResolverBase<HttpVerbs>
{
/// <summary>
/// Initializes a new instance of the <see cref="RouteVerbResolver"/> class.
/// </summary>
/// <param name="matcher">The <see cref="RouteMatcher"/> to match URL paths against.</param>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="matcher"/> is <see langword="null"/>.</para>
/// </exception>
public RouteVerbResolver(RouteMatcher matcher)
: base(matcher)
{
}
/// <inheritdoc />
protected override HttpVerbs GetContextData(IHttpContext context) => context.Request.HttpVerb;
/// <inheritdoc />
protected override bool MatchContextData(HttpVerbs contextVerb, HttpVerbs handlerVerb)
=> handlerVerb == HttpVerbs.Any || contextVerb == handlerVerb;
}
}