Beispiel #1
0
        public IActionResult Index()
        {
            int?id = HttpContext.Session.GetInt32(ID);

            if (id.HasValue)    // check id is in session
            {
                var weddings = dbContext.GetWeddings(id.Value);

                return(View("ViewAllWeddings", weddings));
            }
            else
            {
                return(Redirect("/logout"));
            }
        }