Ejemplo 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);
            }
Ejemplo 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);
            }
Ejemplo 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);
            }
Ejemplo 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);
            }