Esempio n. 1
0
        public ServiceResponse(ServiceSession serviceSession, string command, CancellationToken token)
        {
            if (serviceSession == null)
            {
                throw new ArgumentNullException(nameof(serviceSession));
            }
            if (String.IsNullOrWhiteSpace(command))
            {
                throw new ArgumentNullException(nameof(command));
            }

            ServiceSession = serviceSession;
            using (new ScopeTimeTracker(time => ExecutionTime = time))
                MainApplicationContext = InitializeResponse(command, token);
        }
Esempio n. 2
0
        public ServiceResponse(ServiceSession serviceSession, Action <Journals.Journal> action, CancellationToken token)
        {
            if (serviceSession == null)
            {
                throw new ArgumentNullException(nameof(serviceSession));
            }
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            ServiceSession = serviceSession;
            using (new ScopeTimeTracker(time => ExecutionTime = time))
                MainApplicationContext = InitializeResponse(action, token);
        }