2023-12-24 12:20:03 +00:00
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
2024-03-02 00:43:56 +00:00
|
|
|
using OliverBooth.Common.Data.Web.Projects;
|
|
|
|
using OliverBooth.Common.Services;
|
2023-12-24 12:20:03 +00:00
|
|
|
|
|
|
|
namespace OliverBooth.Pages.Projects;
|
|
|
|
|
|
|
|
public class Project : PageModel
|
|
|
|
{
|
|
|
|
private readonly IProjectService _projectService;
|
|
|
|
|
|
|
|
public Project(IProjectService projectService)
|
|
|
|
{
|
|
|
|
_projectService = projectService;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IProject? SelectedProject { get; private set; }
|
|
|
|
|
|
|
|
public void OnGet(string slug)
|
|
|
|
{
|
|
|
|
if (_projectService.TryGetProject(slug, out IProject? project))
|
|
|
|
{
|
|
|
|
SelectedProject = project;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|