Ejemplo n.º 1
0
        public IActionResult AddChoice(string topicId)
        {
            var model = new AddChoiceVM {
                TopicId = topicId
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        public IActionResult AddChoice(string topicId, AddChoiceVM choice)
        {
            var data = new Choice {
                Name       = choice.ChoiceName,
                CraeteBy   = username,
                CraeteDate = DateTime.Now,
                Id         = Guid.NewGuid().ToString()
            };

            facade.AddChoice(data, topicId, username);
            return(RedirectToAction(nameof(Vote), new { TopicId = topicId }));
        }