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