using System.Reflection; using SimpleModalCanary.Components; using ZB.MOM.WW.OtOpcUa.AdminUI.Uns; var builder=WebApplication.CreateBuilder(args);builder.WebHost.UseStaticWebAssets(); builder.Services.AddRazorComponents().AddInteractiveServerComponents(); builder.Services.AddSingleton(); builder.Services.AddSingleton(services=> {var proxy=DispatchProxy.Create();((SyntheticUnsProxy)(object)proxy).State=services.GetRequiredService();return proxy;}); var app=builder.Build();app.UseAntiforgery();app.MapStaticAssets(); app.MapGet("/fixture/provenance",()=>new {purpose="Loopback synthetic simple modal fixture",backend="No DB, driver, gateway or operational service registration"}); app.MapRazorComponents().AddInteractiveServerRenderMode();app.Run(); public sealed class FixtureState { public int Operations; } public class SyntheticUnsProxy:DispatchProxy { public FixtureState State {get;set;}=null!; protected override object? Invoke(MethodInfo? method,object?[]? args) { if(method?.Name is not ("CreateAreaAsync" or "CreateLineAsync"))throw new InvalidOperationException("Operation refused: "+method?.Name); State.Operations++;return Complete(); } private static async Task Complete(){await Task.Delay(600);return new(true,null);} }