예제 #1
0
        public async Task <Participant> GetParticipantByChallongeIdAsync(string challongeId)
        {
            var filter = Builders <ParticipantBson> .Filter.Eq("challongeId", challongeId);

            var result = await participantCollection.Find(filter).ToListAsync();

            ParticipantBson bson = result.FirstOrDefault();

            return(new Participant(bson));
        }
예제 #2
0
        public async Task <Participant> GetParticipantByPhoneNumberAsync(string phoneNumber)
        {
            var filter = Builders <ParticipantBson> .Filter.Eq("phoneNumber", phoneNumber);

            var result = await participantCollection.Find(filter).ToListAsync();

            ParticipantBson bson = result.FirstOrDefault();

            return(new Participant(bson));
        }
예제 #3
0
 public Participant(ParticipantBson bson)
 {
     this.ChallongeId = bson.ChallongeId;
     this.PhoneNumber = bson.PhoneNumber;
     this.Name        = bson.Name;
 }