Пример #1
0
        static void Main(string[] args)
        {
            IKernel kernel = new StandardKernel(new ServiceModule());

            User user = new User("bayram", "333");
            user.ChangePassword("333333");
            user.Activate();
        }
Пример #2
0
        static void Main(string[] args)
        {
            IKernel kernel = new StandardKernel(new ServiceModule());
            IDomainRepository repository = kernel.Get<IDomainRepository>();

            User user = new User("bayram", "333");
            user.ChangePassword("333333");
            user.Activate();

            repository.Add(user);

            ChangePasswordCommand command = new ChangePasswordCommand();
            command.Password = "******";

            ChangePasswordCommandHandler handler = new ChangePasswordCommandHandler(repository);
            handler.Execute(command);
        }