public Task <BatchJobExecutionResult> Execute(BatchJob batchJob)
        {
            var message = string.Format("There is no executor for this job. To create one, implement {0}<{1}>",
                                        typeof(IBatchJobExecutor).FullName,
                                        batchJob.GetType().FullName);
            var batchJobExecutionResult = BatchJobExecutionResult.Failure(message);

            _setBatchJobExecutionStatus.Complete(batchJob, batchJobExecutionResult);
            return(Task.FromResult(batchJobExecutionResult));
        }
Beispiel #2
0
 public async Task <BatchJobExecutionResult> Execute(BatchJob batchJob)
 {
     return(await BatchJobExecutionResult.TryAsync(() =>
     {
         var job = batchJob as T;
         return job == null
             ? Task.FromResult(BatchJobExecutionResult.Failure("Batch job is not of the correct type"))
             : Execute(job);
     }));
 }