using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;

public abstract class AppController : Controller
{
    public override void OnActionExecuting(ActionExecutingContext context)
    {
        var uid = HttpContext.Session.GetInt32("UserId");
        var uname = HttpContext.Session.GetString("UserName");

        ViewBag.UserId = uid;
        ViewBag.UserName = uname;

        base.OnActionExecuting(context);
    }
}
