I have the following extension methods lying around for this;
/// <summary>
/// Extensions for dealing with <see cref="DateTime"/>
/// </summary>
public static class DateTimeExtensions
{
    #region Range
    private static readonly Func<DateTime, DateTime> DayStep = x => x.AddDays(1);
    private static readonly Func<DateTime, DateTime> MonthStep = x => x.AddMonths(1);
    private static readonly Func<DateTime, DateTime> YearStep = x => x.AddYears(1);
    /// <summary>
    /// Adapted from <see href="https://stackoverflow.com/a/39847791/4122889"/>
    /// <example>
    /// // same result
    /// var fromToday = birthday.RangeFrom(today);
    /// var toBirthday = today.RangeTo(birthday);
    /// </example>
    /// </summary>
    /// <param name="from"></param>
    /// <param name="to"></param>
    /// <param name="step"></param>
    /// <returns></returns>
    public static IEnumerable<DateTime> RangeTo(this DateTime from, DateTime to, Func<DateTime, DateTime>? step = null)
    {
        step ??= DayStep;
        while (from < to)
        {
            yield return from;
            from = step(from);
        }
    }
    public static IEnumerable<DateTime> RangeToMonthly(this DateTime from, DateTime to)
        => RangeTo(from, to, MonthStep);
    public static IEnumerable<DateTime> RangeToYearly(this DateTime from, DateTime to)
        => RangeTo(from, to, YearStep);
    public static IEnumerable<DateTime> RangeFrom(this DateTime to, DateTime from, Func<DateTime, DateTime>? step = null) 
        => from.RangeTo(to, step);
    #endregion
}
Usage;
DateTime.UtcNow.RangeTo(DateTime.UtcNow.AddDays(1), x => x.AddMinutes(30)).ToList()
06/27/2023 12:31:36
06/27/2023 13:01:36
06/27/2023 13:31:36
06/27/2023 14:01:36
06/27/2023 14:31:36
...