using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Website.Data; using Website.ViewModels; namespace Website.Controllers { public class BlogController : Controller { private readonly BlogRepository _repo; public BlogController(BlogRepository repo) { _repo = repo; } public IActionResult Index() { return View(); } public async Task View(int id) { var post = await _repo.GetPost(id); return View(post); } } }