Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
 public Participant(ParticipantBson bson)
 {
     this.ChallongeId = bson.ChallongeId;
     this.PhoneNumber = bson.PhoneNumber;
     this.Name        = bson.Name;
 }