static void Main(string[] args) { // create service collection var serviceCollection = new ServiceCollection(); ConfigureServices(serviceCollection); // create service provider var serviceProvider = serviceCollection.BuildServiceProvider(); var createCommand = new CreateStationCommand(); createCommand.Code = "2dayfm"; createCommand.Name = "2DayFM - Sydney Hit Radio"; // run app var stationCommandPublisher = serviceProvider.GetService <StationCommandPublisher>(); stationCommandPublisher.Execute(createCommand); var editCommand = new EditStationCommand(); editCommand.Uid = Guid.NewGuid(); editCommand.Code = "fox"; editCommand.Name = "Fox - Melbourne Hit Radio"; stationCommandPublisher.Execute(editCommand); System.Console.ReadKey(); }
public void Execute(EditStationCommand command) { var queueName = "EditStation"; PublishQueue(queueName, command); }
public void Handle(EditStationCommand command) { _logger.LogInformation($"Station Command Handler is Handling the Edit Command with Station {command.Name}"); }