Пример #1
0
        public IActionResult Create(string factContext, string tagsString, string selectedTheme)
        {
            User user   = usersService.GetUserById(new Guid(HttpContext.Session.GetString("logeduser")));
            Guid factId = factsService.CreateFact(factContext, user, selectedTheme);
            IEnumerable <Guid> tagsId = tagsService.CreateTags(tagsString);

            foreach (Guid tagId in tagsId)
            {
                factsService.AddTag(factsService.GetFactById(factId), tagsService.GetTagById(tagId));
            }
            return(RedirectToAction("Index"));
        }