Beispiel #1
0
        public async Task <IEnumerable <TaxEntryDto> > GetMunicipalityTaxesForDate(string municipalityName, DateTime date)
        {
            var municipality = await _taxRepository.GetMunicipalityAsync(municipalityName);

            if (municipality == null)
            {
                return(null);
            }

            var taxEntries = await _taxRepository.GetTaxEntriesAsync(municipality.Id, date);

            var taxEntriesForDate = taxEntries.Where(x => date >= x.DateFrom && date < x.DateTo && x.MunicipalityId == municipality.Id).ToList();

            return(_mapper.Map <IEnumerable <TaxEntryDto> >(taxEntriesForDate));;
        }