public async Task <IActionResult> Create(ArticlePostCreateInputModel model)
        {
            if (!await this.categoriesService.CategoryExitsAsync(model.CategoryId))
            {
                return(this.RedirectToAction(nameof(this.Create)));
            }

            if (!this.ModelState.IsValid)
            {
                var categories = await this.categoriesService.GetAllAsync <CategoryDropDownViewModel>();

                model.Categories = categories;
                return(this.View(model));
            }

            var user = await this.userManager.GetUserAsync(this.User);

            var sanitizer = new HtmlSanitizer();

            var content = sanitizer.Sanitize(model.Content);

            var blogPostId = await this.blogPostsService.CreateAsync(model.Title, content, user.Id, model.CategoryId);

            foreach (var image in model.Picture)
            {
                // string name = DateTime.UtcNow.ToString("G", CultureInfo.InvariantCulture);
                string pictureUrl = await this.cloudinaryService.UploadPictureAsync(image, image.FileName, FolderName);

                await this.blogPostsService.CreateArticlePicturesAsync(blogPostId, user.Id, pictureUrl);
            }

            return(this.RedirectToAction(nameof(this.ById), new { id = blogPostId }));
        }
        public async Task <IActionResult> Create()
        {
            var categories = await this.categoriesService.GetAllAsync <CategoryDropDownViewModel>();

            var viewModel = new ArticlePostCreateInputModel()
            {
                Categories = categories,
            };

            return(this.View(viewModel));
        }