Пример #1
0
        public async Task <ActionResult> OnPostRegister(int?id, [FromServices] UserManager <User> userManager)
        {
            User = await userManager.GetUserAsync(HttpContext.User);

            CompetitionDto = _competitionService.GetCompetitions().Single(c => c.Id == id);
            Participation par = new Participation()
            {
                CompetitionId = CompetitionDto.Id,
                UserId        = User.Id
            };

            _participationService.addParticipation(par);

            return(Redirect($"./Details?id=" + id));
        }