public async Task <List <MatchDetail> > GetProfileMatches(string profileId) { var results = await _matchesRepository.GetMatchesForProfile(profileId); var matches = results.Select(ma => MatchDetailMapper.ToContract(profileId, ma)) .ToList(); return(matches); }
public async Task <MatchDetail> UpdateMatch(MatchDetail match) { var entity = await _matchesRepository.GetMatch(match.Id); entity.MatchContactPreferences.First(mc => mc.ProfileId == match.ProfileId).ContactDetailsVisible = match.UserContactDetailsVisible; var updatedEntity = await _matchesRepository.UpsertMatch(entity); var updatedMatch = MatchDetailMapper.ToContract(match.ProfileId, updatedEntity); return(updatedMatch); }