public async Task <ObservableCollection <Sponsor> > GetSponsorsAsync(Guid verenigingId) { if (_cachedSponsors == null || (_today == null || _today < DateTime.Today)) { _cachedSponsors = new ObservableCollection <Sponsor>(); Vereniging vereniging = await _verenigingRepository.GetVerenigingAsync(); List <Sponsor> sponsoren = await _sponsorService.GetSponsorenAsync(vereniging.Id); foreach (Sponsor sponsor in sponsoren) { if (_cachedSponsors.Count(s => s.Id == sponsor.Id) == 0) { if (sponsor.AfbeeldingId != null && sponsor.AfbeeldingId.HasValue) { Foto foto = await GetSponsorImageAsync(verenigingId, sponsor.AfbeeldingId.Value); sponsor.Path = new Uri(_baseUri, string.Format("{0}.jpg", sponsor.Id)); } else { sponsor.Path = new Uri("ms-appx:///Assets/placeHolderSponsor.png"); } _cachedSponsors.Add(sponsor); } } //Foto _foto = await GetSponsorImageAsync(verenigingId, Guid.Empty); _today = DateTime.Today; } return(_cachedSponsors); }