예제 #1
0
파일: Program.cs 프로젝트: zjxbetter/enode
        static void Main(string[] args)
        {
            InitializeENodeFramework();

            var commandService = ObjectContainer.Resolve <ICommandService>();

            var noteId   = ObjectId.GenerateNewStringId();
            var command1 = new CreateNoteCommand {
                AggregateRootId = noteId, Title = "Sample Title1"
            };
            var command2 = new TestEventsCommand {
                AggregateRootId = noteId
            };

            Console.WriteLine(string.Empty);

            commandService.ExecuteAsync(command1, CommandReturnType.EventHandled).Wait();
            commandService.ExecuteAsync(command2, CommandReturnType.EventHandled).Wait();

            Console.WriteLine(string.Empty);

            _logger.Info("Press Enter to exit...");

            Console.ReadLine();
            _configuration.ShutdownEQueue();
        }
예제 #2
0
파일: Program.cs 프로젝트: linkai0924/enode
        static void Main(string[] args)
        {
            InitializeENodeFramework();

            var commandService = ObjectContainer.Resolve<ICommandService>();

            var noteId = ObjectId.GenerateNewStringId();
            var command1 = new CreateNoteCommand { AggregateRootId = noteId, Title = "Sample Title1" };
            var command2 = new TestEventsCommand { AggregateRootId = noteId };

            Console.WriteLine(string.Empty);

            commandService.ExecuteAsync(command1, CommandReturnType.EventHandled).Wait();
            commandService.ExecuteAsync(command2, CommandReturnType.EventHandled).Wait();

            Console.WriteLine(string.Empty);

            _logger.Info("Press Enter to exit...");

            Console.ReadLine();
            _configuration.ShutdownEQueue();
        }