public async Task <FipInformationDto> GetDayRangeByCountyAsync(CountyDto county) { CountyInfoEntity countyEntity = await _dateOptimizerContext.CountyInfo.SingleOrDefaultAsync(x => x.County == county.County && x.State == county.State).ConfigureAwait(false); DayRangeEntitity entity = await _dateOptimizerContext.AppraisalPercentages.SingleOrDefaultAsync(x => x.Fip == countyEntity.Fip).ConfigureAwait(false); FipInformationDto fipDto = new FipInformationDto { fip = entity.Fip, Days = new double[11], }; fipDto.Days[0] = entity.Day0; fipDto.Days[1] = entity.Day1; fipDto.Days[2] = entity.Day2; fipDto.Days[3] = entity.Day3; fipDto.Days[4] = entity.Day4; fipDto.Days[5] = entity.Day5; fipDto.Days[6] = entity.Day6; fipDto.Days[7] = entity.Day7; fipDto.Days[8] = entity.Day8; fipDto.Days[9] = entity.Day9; fipDto.Days[10] = entity.Day10; return(fipDto); }
public async Task <DayRangeDto> GetDatesByFipAsync(int fip) { FipInformationDto fipInfo = await _repository.GetDayRangeByFipAsync(fip).ConfigureAwait(false); int start = -1; int end = -1; for (int i = 0; i < fipInfo.Days.Length; i++) { if (fipInfo.Days[i] > 0 && start == -1) { start = i; } if (fipInfo.Days[i] > .75 && end == -1) { end = i; } } int range = end - start; var dayRange = new DayRangeDto() { StartDay = start, DayRange = range, }; return(dayRange); }