BlogService now fetches from Media.JoshHeaps.Net API via HttpClient with in-memory caching (5-min TTL) and stale cache fallback. Removed Markdig/YamlDotNet dependencies. All page models now async. Co-Authored-By: Claude Opus 4.6 <[email protected]>
18 lines
465 B
C#
18 lines
465 B
C#
using JoshHeaps.Net.Models;
|
|
using JoshHeaps.Net.Services.Interfaces;
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
namespace JoshHeaps.Net.Pages
|
|
{
|
|
public class IndexModel(IBlogService blogService) : PageModel
|
|
{
|
|
public List<BlogPost> LatestPosts { get; set; } = [];
|
|
|
|
public async Task OnGetAsync()
|
|
{
|
|
var allPosts = await blogService.GetAllPostsAsync();
|
|
LatestPosts = allPosts.Take(3).ToList();
|
|
}
|
|
}
|
|
}
|