public IActionResult GetLatest() { using (var db = new AppDb()) { db.Connection.Open(); var query = new BlogPostQuery(db); var result = query.LatestPosts(); return(new OkObjectResult(result)); } }