Пример #1
0
        public IActionResult Index()
        {
            var repo   = new JokesRepository(_connectionString);
            var authDb = new Authentication(_connectionString);

            JokesModelView mv = new JokesModelView();

            mv.User = authDb.GetByEmail(User.Identity.Name);
            if (mv.User != null)
            {
                mv.UserJokes = repo.GetJokesForUser(mv.User.Id);
            }

            return(View(mv));
        }