예제 #1
0
        public ActionResult Create(SomeCreateModel model)
        {
            if (ModelState.IsValid)
            {
                var command = new CreateCommand(Guid.NewGuid());
                command.Map <INameModel>(model);
                command.Map <IValueModel>(model);

                new SomeCommandBus().Publish(command);

                return(View("View", new SomeViewModel
                {
                    Id = command.Id
                }
                            .Map <SomeViewModel, INameModel>(command)
                            .Map <SomeViewModel, IValueModel>(command)
                            ));
            }
            return(View(model));
        }