using FrontOffice.Main.Utilities.Seo;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace FrontOffice.Main.Pages;

public class HostModel : PageModel
{
    private readonly SeoMetadataProvider _seoMetadataProvider;

    public SeoPageMetadata Seo { get; private set; } = default!;

    public HostModel(SeoMetadataProvider seoMetadataProvider)
    {
        _seoMetadataProvider = seoMetadataProvider;
    }

    public async Task OnGetAsync()
    {
        Seo = await _seoMetadataProvider.GetForPathAsync(Request.Path);
    }
}
