public async Task <IActionResult> Create(int id, int sourceId)
        {
            CreateKnowledgeContentViewModel createKnowledgeSectionViewModel;

            if (id == 0)
            {
                createKnowledgeSectionViewModel = new CreateKnowledgeContentViewModel
                {
                    Attached = false,
                    Sources  = await getKnowledgeSourceViewModelList(),
                    UserId   = GetAuthenticatedUserId(),
                    CategoriesWithConcepts = await getCategoriesWithConceptsSelectList()
                };
            }
            else
            {
                createKnowledgeSectionViewModel = new CreateKnowledgeContentViewModel
                {
                    Attached               = true,
                    Sources                = await getKnowledgeSourceViewModelList(),
                    UserId                 = GetAuthenticatedUserId(),
                    ConceptId              = id,
                    ConceptName            = await getConceptName(id),
                    CategoriesWithConcepts = await getCategoriesWithConceptsSelectList()
                };
            }

            if (sourceId != 0)
            {
                createKnowledgeSectionViewModel.SourceId = sourceId;
            }

            return(View(createKnowledgeSectionViewModel));
        }
        public async Task <IActionResult> Create(CreateKnowledgeContentViewModel model)
        {
            if (!ModelState.IsValid)
            {
                model.CategoriesWithConcepts = await getCategoriesWithConceptsSelectList();

                return(View(model));
            }

            var result = await _mediator.Send(new CreateKnowledgeContentCommand(model.Content, model.Comment, GetAuthenticatedUserId(), model.ConceptId, model.SourceId));

            if (result.IsSuccess)
            {
                TempData["Success"] = _localizer["Content has been created."].Value;
                if (model.ConceptId != 0)
                {
                    return(RedirectToAction("Details", "KnowledgeConcept", new { id = model.ConceptId }));
                }
                else
                {
                    return(RedirectToAction(nameof(Index)));
                }
            }
            else
            {
                model.CategoriesWithConcepts = await getCategoriesWithConceptsSelectList();

                ModelState.AddModelError("", result.Message);
                return(View(model));
            }
        }