User713522837 posted
I have the input the object as below
var orderAvailability = new OrdderAvailabilty{
StartDate = new DateTime(2019.5,21),
EndDate = new DateTime(2019,5,27)
Availability = new List<int>{0,0,0,1,0,0,0}
}
Each list item in the 'Availability' listed above corresponds to each date from StartDate and EndDate inclusive. For the above example, there are 7 list items and the date range is from 21st and 27th (7 days) i.e.,
Availability on 21st is 0, 22nd is 0, 23rd is 0, 24th is 1, 25th is 0, 26th is 0 and 27th is 0. Starting from the 21st, there are 3 sets of availability
availability from 21st till 23rd is 0
availabily on 24th is 1
availability from 25th till 27th is 0
The required output should be
From | To | Available
21/5/2019 | 23/5/2019 | 0
24/5/2019 | 24/5/2019 | 1
25/5/2019 | 27/5/2019 | 0
Please could anyone help