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,33 @@
using System;
namespace EmbedIO.Utilities
{
partial class Validate
{
/// <summary>
/// Ensures that the value of an argument is a valid route.
/// </summary>
/// <param name="argumentName">The name of the argument to validate.</param>
/// <param name="value">The value to validate.</param>
/// <param name="isBaseRoute"><see langword="true"/> if the argument must be a base route;
/// <see langword="false"/> if the argument must be a non-base route.</param>
/// <returns><paramref name="value"/>, if it is a valid route.</returns>
/// <exception cref="ArgumentNullException"><paramref name="value"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException">
/// <para><paramref name="value"/> is empty.</para>
/// <para>- or -</para>
/// <para><paramref name="value"/> does not start with a slash (<c>/</c>) character.</para>
/// <para>- or -</para>
/// <para><paramref name="value"/> does not comply with route syntax.</para>
/// </exception>
/// <seealso cref="Routing.Route.IsValid"/>
public static string Route(string argumentName, string value, bool isBaseRoute)
{
var exception = Routing.Route.ValidateInternal(argumentName, value, isBaseRoute);
if (exception != null)
throw exception;
return Utilities.UrlPath.UnsafeNormalize(value, isBaseRoute);
}
}
}