예제 #1
0
        /// <summary>
        /// ユーザ登録
        /// </summary>
        /// <param name="inputData"></param>
        public void Handle(UserCreateInputData inputData)
        {
            var username      = inputData.UserName;
            var duplicateUser = userRepository.FindByUserName(username);

            if (duplicateUser != null)
            {
                throw new Exception("duplicated");
            }

            var user = new src.Domain.Domain.Users.User(username);

            userRepository.Save(user);
            var outputData = new UserCreateOutputData(user.Id, DateTime.Now);

            presenter.Complete(outputData);
        }
예제 #2
0
 /// <summary>
 /// ユーザ登録
 /// </summary>
 /// <param name="inputData"></param>
 public void Handle(UserCreateInputData inputData)
 {
     throw new Exception();
 }
예제 #3
0
        public void CreateUser(string userName)
        {
            var inputData = new UserCreateInputData(userName);

            userCreateUseCase.Handle(inputData);
        }
        /// <summary>
        /// ユーザ登録
        /// </summary>
        /// <param name="inputData"></param>
        public void Handle(UserCreateInputData inputData)
        {
            var outputData = new UserCreateOutputData((id++).ToString(), DateTime.Now);

            presenter.Complete(outputData);
        }