示例#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;
 }