public MessageProcessor(IOptionsMonitor <TouchPortalApiOptions> options, ITPClient tPClient, IProcessQueueingService processQueueingService,
                         CancellationToken cancellationToken = default)
 {
     _options  = options ?? throw new ArgumentNullException(nameof(options));
     _tPClient = tPClient ?? throw new ArgumentNullException(nameof(tPClient));
     _processQueueingService = processQueueingService ?? throw new ArgumentNullException(nameof(processQueueingService));
     _cancellationToken      = cancellationToken;
 }
Exemple #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="options">Configured TP Options</param>
        /// <param name="socket">The TP Socket Object</param>
        /// <param name="processQueueingService">THe Process Queue Service</param>
        /// <param name="cancellationToken">Cancellation Token</param>
        public TPClient(IOptionsMonitor <TouchPortalApiOptions> options, ITPSocket socket, IProcessQueueingService processQueueingService)
        {
            _options  = options ?? throw new ArgumentNullException(nameof(options));
            _tpsocket = socket ?? throw new ArgumentNullException(nameof(socket));
            _processQueueingService = processQueueingService ?? throw new ArgumentNullException(nameof(processQueueingService));

            // Add this somewhere in your project, most likely in Startup.cs
            JsonConvert.DefaultSettings = () => new JsonSerializerSettings {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            };

            InitializeConnection();
        }