Exemple #1
0
        /// <summary>
        /// This method retrieves the process service and runs it.
        /// </summary>
        /// <param name="state">The state. This is not used.</param>
        private void ProcessAll(object state)
        {
            using var scope        = this.Services.CreateScope();
            using var serviceScope = scope.ServiceProvider
                                     .GetRequiredService <IServiceScopeFactory>()
                                     .CreateScope();

            using var context = serviceScope.ServiceProvider.GetService <Context>();
            var splitwiseContext = serviceScope.ServiceProvider.GetService <ISplitwiseContext>();

            var processor = new TransactionProcessor(context, splitwiseContext);

            processor.ProcessAll();
        }