public async Task <IActionResult> AddParticipant(int eventId) { if (eventId != 0) { var eventDto = await _eventManager.GetEventById(eventId); var userId = await _accountManager.GetUserIdByNameAsync(User.Identity.Name); await _eventManager.AddParticipantAsync(eventId, userId, eventDto); } else { return(NotFound(ModelErrorsResource.EventNotFound)); } return(RedirectToAction("Index", "Home")); }