コード例 #1
0
        public async Task DeleteParticipationRequest(Guid userId, Guid competitionId)
        {
            var participationRequest = await _participationRequestRepo.Get(userId, competitionId);

            participationRequest.EnsureExists("Participant request not found.");

            _participationRequestRepo.Delete(participationRequest);
            await _participationRequestRepo.Save();
        }
コード例 #2
0
        public async Task <ParticipantResponse> AddParticipantToCompetitionAsAdmin(Guid differentUserId, Guid competitionId)
        {
            var participationRequest = await _participationRequestRepo.Get(differentUserId, competitionId);

            participationRequest.EnsureExists("Participation request not found.");

            var participant = new Participant(differentUserId, competitionId);

            _participationRequestRepo.Delete(participationRequest);
            _participantRepo.Create(participant);
            await _participantRepo.Save();

            return(new ParticipantResponse(participant));
        }