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,22 @@
using System;
using System.Collections.Specialized;
using System.Threading.Tasks;
namespace EmbedIO.WebApi
{
/// <summary>
/// <para>Specifies that a parameter of a controller method will receive a <see cref="NameValueCollection"/>
/// of HTML form data, obtained by deserializing a request URL query.</para>
/// <para>The received collection will be read-only.</para>
/// <para>This class cannot be inherited.</para>
/// </summary>
/// <seealso cref="Attribute" />
/// <seealso cref="IRequestDataAttribute{TController,TData}" />
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class QueryDataAttribute : Attribute, IRequestDataAttribute<WebApiController, NameValueCollection>
{
/// <inheritdoc />
public Task<NameValueCollection?> GetRequestDataAsync(WebApiController controller, string parameterName)
=> Task.FromResult(controller.HttpContext.GetRequestQueryData());
}
}