Exemplo n.º 1
0
        public DbMessageSender(IConfiguration configuration, MessagesRepository messagesRepository, IOptionsMonitor <ILog> options)
        {
            var setting = configuration["messaging:enabled"];

            MessagingEnabled   = !string.IsNullOrEmpty(setting) && setting == "true";
            MessagesRepository = messagesRepository;
            log = options.Get("ASC.Messaging");
        }
Exemplo n.º 2
0
        public void Send(EventMessage message)
        {
            try
            {
                if (!MessagingEnabled)
                {
                    return;
                }

                if (message == null)
                {
                    return;
                }

                MessagesRepository.Add(message);
            }
            catch (Exception ex)
            {
                log.Error("Failed to send a message", ex);
            }
        }
Exemplo n.º 3
0
 public DbMessageSender()
 {
     messagesRepository = new MessagesRepository();
 }