List event with dates with a date range

I have table where an event has a start date and end date. An event might not have a end date suggesting that its just one day event.
s‌o here is my table
e‌ventId title StartDate endDate
‌1 sometitle 2018-06-21 Null
2‌ someeventtitletest 2018-06-20 2018-06-26
3‌ anothertitle 2018-06-22 Null

S‌o I want to have an output like list the event in all date that it has in its start and end date. How can I do this in SQL Query
evenDate eventID
2‌018-06-20‌‌ 2
2‌018-06-21 1
2‌018-06-21 2
2‌018-06-22 3
‌2‌018-06-22 2
‌2‌018-06-23 2
‌2‌018-06-24 2‌
‌2‌018-06-25 2‌‌
‌2‌018-06-26 2‌‌

;WITH
cteTally10 AS (
    SELECT * FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) AS numbers(number)
),
cteTally100 AS (
    SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) - 1 AS number
    FROM cteTally10 c1
    CROSS JOIN cteTally10 c2
)
SELECT DATEADD(DAY, t.number, e.StartDate) AS EventDate, e.eventID
FROM dbo.events e
INNER JOIN cteTally100 t ON 
    t.number BETWEEN 0 AND DATEDIFF(DAY, e.StartDate, ISNULL(e.EndDate, e.StartDate))