public void SendPendingEmails() { if (!ExistPendingEmails()) { _logger.LogInformation("There are no pending emails"); return; } var emailsToSend = GetEmailsToSend(); _senderService.SendEmails(emailsToSend); _logger.LogInformation("Sent emails count: {0}", emailsToSend.Where(e => e.Status == eEmailStatus.Sent).Count()); }