Example #1
0
        public async Task <IActionResult> Add([FromForm] CreateVotingDto dto)
        {
            if (ModelState.IsValid)
            {
                int createdVotingId = await _votingService.AddAsync(dto, User);

                return(RedirectToAction("Get", new { id = createdVotingId }));
            }

            return(View(dto));
        }