Beispiel #1
0
        public async Task <IActionResult> Add(AdminPhotoInputModel model)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction(nameof(Index)));
            }

            var userId = this.userManager.GetUserId(this.User);

            await this.cloudinaryService.UploadImageAsync(model.Photo, userId);

            return(RedirectToAction(nameof(Index)));
        }
Beispiel #2
0
        public IViewComponentResult Invoke()
        {
            var model = new AdminPhotoInputModel();

            return(View(model));
        }