Removed Immediate.Apis, Added AOT Testing Scripts.
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
using Htmx.ApiDemo;
|
||||
using Htmx.ApiDemo.Templates.Components;
|
||||
using Immediate.Apis.Shared;
|
||||
using Immediate.Handlers.Shared;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Htmx.ApiDemo.Templates;
|
||||
namespace Htmx.ApiDemo;
|
||||
|
||||
public sealed class MainLayout : MainLayoutBase
|
||||
public sealed class MainLayout : Templates.MainLayoutBase
|
||||
{
|
||||
private byte[] _titleData = [];
|
||||
private byte[] _appNameData = [];
|
||||
@@ -67,24 +65,4 @@ public sealed class MainLayout : MainLayoutBase
|
||||
protected override void RenderAppName(HtmxRenderContext context) => context.Writer.WriteUtf8(_appNameData);
|
||||
protected override void RenderPageTitle(HtmxRenderContext context) => context.Writer.WriteUtf8(_pageTitleData);
|
||||
protected override void RenderUserSection(HtmxRenderContext context) => context.Writer.WriteUtf8(_userSectionData);
|
||||
}
|
||||
|
||||
|
||||
[Handler]
|
||||
[MapGet("/")]
|
||||
public static partial class GetIndexHandler
|
||||
{
|
||||
public class Command;
|
||||
|
||||
private static ValueTask<IResult> HandleAsync(
|
||||
Command command,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
CancellationToken token)
|
||||
{
|
||||
var context = httpContextAccessor.HttpContext
|
||||
?? throw new InvalidOperationException("HttpContext is not available.");
|
||||
|
||||
var greet = new Greeting { Username = "Enciphered", Count = 0, GreetingId = Guid.NewGuid() };
|
||||
return ValueTask.FromResult<IResult>(context.WriteHtmxPage(greet, title: "Home", appName: "HtmxApp", pageTitle: "Home"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user