/// <summary>
        /// Initializes a new instance of the <see cref="SendFunction"/> class.
        /// </summary>
        /// <param name="options">Send function options.</param>
        /// <param name="notificationService">The service to precheck and determine if the queue message should be processed.</param>
        /// <param name="messageService">Message service.</param>
        /// <param name="notificationRepo">Notification repository.</param>
        /// <param name="sendQueue">The send queue.</param>
        /// <param name="localizer">Localization service.</param>
        /// <param name="sentNotificationUpdateDataRepository">SentNotificationUpdateDataRepository service.</param>
        /// <param name="sentUpdateandDeleteNotificationDataRepository">SentUpdateandDeleteNotificationDataRepository service.</param>
        public SendFunction(
            IOptions <SendFunctionOptions> options,
            INotificationService notificationService,
            IMessageService messageService,
            ISendingNotificationDataRepository notificationRepo,
            ISendQueue sendQueue,
            IStringLocalizer <Strings> localizer,
            ISentUpdateDataRepository sentNotificationUpdateDataRepository,
            ISentUpdateandDeleteNotificationDataRepository sentUpdateandDeleteNotificationDataRepository)
        {
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            this.maxNumberOfAttempts           = options.Value.MaxNumberOfAttempts;
            this.sendRetryDelayNumberOfSeconds = options.Value.SendRetryDelayNumberOfSeconds;

            this.notificationService = notificationService ?? throw new ArgumentNullException(nameof(notificationService));
            this.messageService      = messageService ?? throw new ArgumentNullException(nameof(messageService));
            this.notificationRepo    = notificationRepo ?? throw new ArgumentNullException(nameof(notificationRepo));
            this.sendQueue           = sendQueue ?? throw new ArgumentNullException(nameof(sendQueue));
            this.localizer           = localizer ?? throw new ArgumentNullException(nameof(localizer));
            this.sentNotificationUpdateDataRepository          = sentNotificationUpdateDataRepository ?? throw new ArgumentNullException(nameof(sentNotificationUpdateDataRepository));
            this.sentUpdateandDeleteNotificationDataRepository = sentUpdateandDeleteNotificationDataRepository ?? throw new ArgumentNullException(nameof(sentUpdateandDeleteNotificationDataRepository));
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StoreMessageActivity"/> class.
 /// </summary>
 /// <param name="notificationRepo">Sending notification data repository.</param>
 /// <param name="cardCreator">The adaptive card creator.</param>
 public StoreMessageActivity(
     ISendingNotificationDataRepository notificationRepo,
     AdaptiveCardCreator cardCreator)
 {
     this.sendingNotificationDataRepository = notificationRepo ?? throw new ArgumentNullException(nameof(notificationRepo));
     this.adaptiveCardCreator = cardCreator ?? throw new ArgumentNullException(nameof(cardCreator));
 }