2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2026-01-27 01:20:39 +00:00

Annotations

This commit is contained in:
2026-01-19 18:38:34 +03:00
parent 74a71a32f1
commit 63ba506338
8 changed files with 157 additions and 48 deletions

View File

@@ -11,6 +11,7 @@ using Esiur.Net.IIP;
using System.Diagnostics;
namespace Esiur.Proxy;
public static class TemplateGenerator
{
internal static Regex urlRegex = new Regex(@"^(?:([\S]*)://([^/]*)/?)");
@@ -300,8 +301,13 @@ public static class TemplateGenerator
var positionalArgs = f.Arguments.Where((x) => !x.Optional).ToArray();
var optionalArgs = f.Arguments.Where((x) => x.Optional).ToArray();
if (f.Annotation != null)
rt.AppendLine($"[Annotation({ToLiteral(f.Annotation)})]");
if (f.Annotations != null)
{
foreach (var kv in f.Annotations)
{
rt.AppendLine($"[Annotation({ToLiteral(kv.Key)}, {ToLiteral(kv.Value)})]");
}
}
if (f.IsStatic)
{