Beispiel #1
0
        public void Send <TCommand>(TCommand cmd) where TCommand : ICommand
        {
            try
            {
                var unitOfWork = UnitOfWorkContext.StartUnitOfWork();

                var executor = ObjectContainer.Resolve <ICommandExecutor <TCommand> >();
                executor.Execute(cmd);

                UnitOfWorkContext.Commit();
            }
            finally
            {
                UnitOfWorkContext.Close();
            }
        }