using Microsoft.AspNetCore.Mvc.RazorPages; using TaxBaik.Application.Services; using TaxBaik.Domain.Entities; namespace TaxBaik.Web.Pages; public class IndexModel : PageModel { private readonly BlogService _blogService; public List RecentPosts { get; set; } = []; public IndexModel(BlogService blogService) { _blogService = blogService; } public async Task OnGetAsync() { try { var (posts, _) = await _blogService.GetPublishedPagedAsync(1, 3); RecentPosts = posts.ToList(); } catch { RecentPosts = []; } } }