oliverbooth.dev/OliverBooth/Pages/Projects/Project.cshtml.cs
Oliver Booth 6ec4103a3a
refactor: separate Markdig extensions from project
Also introduces .Common project to house common references and types
2024-05-05 02:18:20 +01:00

25 lines
592 B
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
using OliverBooth.Common.Data.Web;
using OliverBooth.Common.Services;
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;
}
}
}