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:
22
Vendor/EmbedIO-3.5.2/WebApi/QueryDataAttribute.cs
vendored
Normal file
22
Vendor/EmbedIO-3.5.2/WebApi/QueryDataAttribute.cs
vendored
Normal 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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user