Esempio n. 1
0
        public async Task <Tax> Search(string municipality, DateTime date)
        {
            var taxes = await _taxRepository.ListAsync();

            var taxesForMunicipality = taxes
                                       .Where(tax => tax.Municipality == municipality)
                                       .OrderBy(tax => tax.TaxType);

            var tax = taxesForMunicipality.FirstOrDefault(tax => tax.StartDate.Date <= date.Date && date.Date <= tax.EndDate.Date);

            return(tax);
        }