コード例 #1
0
        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();
        }
コード例 #2
0
        public void Execute(EditStationCommand command)
        {
            var queueName = "EditStation";

            PublishQueue(queueName, command);
        }
コード例 #3
0
 public void Handle(EditStationCommand command)
 {
     _logger.LogInformation($"Station Command Handler is Handling the Edit Command with Station {command.Name}");
 }