protected IList<DayRequestsDto> GetDayDtoList(DateTime beginDate, DateTime endDate) { IList<DayRequestsDto> dtoList = new List<DayRequestsDto>(); DateTime current = beginDate; while(current <= endDate) { DayRequestsDto dto = new DayRequestsDto { Day = current }; dtoList.Add(dto); current = current.AddDays(1); } return dtoList; }
protected IList<DayRequestsDto> GetDayDtoList(int month, int year) { DateTime current = new DateTime(year, month, 1); IList<DayRequestsDto> dtoList = new List<DayRequestsDto>(); for (int i = 0; i < 31; i++) { DayRequestsDto dto = new DayRequestsDto { Day = current }; if (current.Month != month) break; dtoList.Add(dto); current = current.AddDays(1); } return dtoList; }