Esempio n. 1
0
            public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
            {
                var enqueuedState = context.NewState as EnqueuedState;

                if (enqueuedState == null)
                {
                    throw new InvalidOperationException(
                              $"`{typeof (Handler).FullName}` state handler can be registered only for the Enqueued state.");
                }

                transaction.AddToQueue(enqueuedState.Queue, context.BackgroundJob.Id);
            }
Esempio n. 2
0
            public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
            {
                var enqueuedState = context.NewState as EnqueuedState;

                if (enqueuedState == null)
                {
                    throw new InvalidOperationException(String.Format(
                                                            "`{0}` state handler can be registered only for the Enqueued state.",
                                                            typeof(Handler).FullName));
                }

                transaction.AddToQueue(enqueuedState.Queue, context.JobId);
            }
Esempio n. 3
0
            public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
            {
                var enqueuedState = context.NewState as EnqueuedState;
                if (enqueuedState == null)
                {
                    throw new InvalidOperationException(String.Format(
                        "`{0}` state handler can be registered only for the Enqueued state.",
                        typeof(Handler).FullName));
                }

                transaction.AddToQueue(enqueuedState.Queue, context.JobId);
            }
Esempio n. 4
0
            public void Apply(ApplyStateContext context, IWriteOnlyTransaction transaction)
            {
                var enqueuedState = context.NewState as EnqueuedState;
                if (enqueuedState == null)
                {
                    throw new InvalidOperationException(
                        $"`{typeof (Handler).FullName}` state handler can be registered only for the Enqueued state.");
                }

                transaction.AddToQueue(enqueuedState.Queue, context.BackgroundJob.Id);
            }