I have an application written in c# to allow users to manage events, when adding I allow the users to add a repeat type of Daily,Monthly,Weekly and another option to select how many times it should be repeated or till what day it should be repeated.
Now when displaying the events I need to show all the events that are available for a week.
EX: The user adds an event today and that event repeats daily for 30 days
When displaying the events I query for events using
var events = db.Evnt.Where(l => l.repeatTill >= weekEnd).ToList()
Once I get the results I need to generate the repeating events and display them to the user, How can I achieve this
Final output should be something like this
E1
11/24/2019 10:00 - 11/24/2019 11:00
E1
11/25/2019 10:00 - 11/25/2019 11:00
E1
11/26/2019 10:00 - 11/26/2019 11:00
E1
11/27/2019 10:00 - 11/27/2019 11:00
E1
11/28/2019 10:00 - 11/28/2019 11:00
E1
11/29/2019 10:00 - 11/29/2019 11:00
E1
11/30/2019 10:00 - 11/30/2019 11:00
E1
12/01/2019 10:00 - 12/01/2019 11:00
If the user filters from 11/24/2019 - 12/08/2019 the output should be
E1
11/24/2019 10:00 - 11/24/2019 11:00
E1
11/25/2019 10:00 - 11/25/2019 11:00
E1
11/26/2019 10:00 - 11/26/2019 11:00
E1
11/27/2019 10:00 - 11/27/2019 11:00
E1
11/28/2019 10:00 - 11/28/2019 11:00
E1
11/29/2019 10:00 - 11/29/2019 11:00
E1
11/30/2019 10:00 - 11/30/2019 11:00
E1
12/01/2019 10:00 - 12/01/2019 11:00
E1
12/02/2019 10:00 - 12/02/2019 11:00
E1
12/03/2019 10:00 - 12/03/2019 11:00
E1
12/04/2019 10:00 - 12/04/2019 11:00
E1
12/05/2019 10:00 - 12/05/2019 11:00
E1
12/06/2019 10:00 - 12/06/2019 11:00
E1
12/07/2019 10:00 - 12/07/2019 11:00
E1
12/08/2019 10:00 - 12/08/2019 11:00
How can I achieve this?