public async Task <AppointmentsForMonth> SearchAppointmentsByYearMonthAsync(YearMonth yearMonth)
        {
            var interval   = yearMonth.ToDateInterval();
            var aggregates = await _repository.SearchAsync(interval.Start, interval.End);

            var config = await _configManager.GetConfigAsync();

            var response = new AppointmentsForMonth(yearMonth, config);

            foreach (var date in interval)
            {
                response.Appointments.Add(new AppointmentsForDay(date, config, aggregates.Where(a => a.From.Date == date).ToList()));
            }
            return(response);
        }
        public async Task <IActionResult> OnGet()
        {
            var appointmentConfig = await _appointmentConfigManager.GetConfigAsync();

            AvailableIntervalStart = FormatDate(appointmentConfig.AvailableIntervalStart);
            AvailableIntervalEnd   = FormatDate(appointmentConfig.AvailableIntervalEnd);
            var emailConfig = await _emailConfigurationManager.GetConfigAsync();

            Host     = emailConfig.Host;
            Port     = emailConfig.Port;
            UseSsl   = emailConfig.UseSsl;
            Username = emailConfig.Username;
            Password = emailConfig.Password;
            var messageTemplate = await _service.FindTempalateByNameAsync("AppointmentAcceptedMessage");

            AppointmentAcceptedMessageFromTemplate    = messageTemplate?.FromTemplate;
            AppointmentAcceptedMessageSubjectTemplate = messageTemplate?.SubjectTemplate;
            AppointmentAcceptedMessageBodyTemplate    = messageTemplate?.BodyTemplate;
            return(Page());
        }