Exemple #1
0
        public async Task <IActionResult> FeaturePhotoList()
        {
            ApplicationUser user = await _userManager.GetUserAsync(HttpContext.User);

            if (user.UserName.Equals(_admin))
            {
                return(View("FeaturePhotoError"));
            }

            List <Photo> photos = await _repository.GetAllPhotosAsync();

            FeatureViewModel model = new FeatureViewModel();

            foreach (Photo photo in photos)
            {
                model.Photos.Add(photo);
            }
            return(View("FeaturePhoto", model));
        }