コード例 #1
0
        public ActionResult Create(ClientModel clientModel)
        {
            if (!ModelState.IsValid)
            {
                return(this.RedirectToAction(f => f.New()));
            }
            Client client = new Client();

            client.Name = clientModel.Name;
            _clientCommandRepository.Add(client);
            return(this.RedirectToAction <HomeController>(f => f.Index()));
        }
コード例 #2
0
        public void Handle(ClientCreateCommand command)
        {
            Client client = new Client();

            client.Name = command.Name;
            _clientCommandRepository.Add(client);
        }
コード例 #3
0
        public ActionResult Create(ClientModel clientModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("New", clientModel));
            }
            Client client = new Client();

            client.Name = clientModel.Name;
            _clientCommandRepository.Add(client);
            return(RedirectToAction("Index", "ClientList"));
        }