@page "/admin/blog-posts" @using System.Diagnostics @using Microsoft.AspNetCore.Mvc.TagHelpers @using OliverBooth.Common.Data @using OliverBooth.Common.Data.Blog @using OliverBooth.Common.Data.Web.Users @using OliverBooth.Common.Services @model OliverBooth.Pages.Admin.BlogPosts @inject IBlogPostService BlogPostService @inject IUserService UserService @inject ISessionService SessionService @{ ViewData["Title"] = "Blog Posts"; Layout = "Shared/_AdminLayout"; HttpRequest request = HttpContext.Request; SessionService.TryGetSession(request, out ISession? session); IUser? user = null; if (session is not null) { UserService.TryGetUser(session.UserId, out user); } Debug.Assert(user is not null); }