public void StartJob(string type, string payload) { var cmd = new StartJobCommand { Name = type, Payload = payload }; WebApiApplication.Bus.Send(cmd); }
public static void StartJob(StartJobCommand command, IBus bus) { var job = new JobInstance { Id = Guid.NewGuid(), Name = command.Name, Payload = command.Payload }; _jobs[job.Id] = job; job.Start(bus.Publish); }