Exemplo n.º 1
0
 public ActionResult CreateNews(CreateNewsCommand command)
 {
     Configuration.Instance().Bus.Handle(command);
     //var news = Configuration.Instance().NewsReadModel.News;
     //Configuration.Context().NewsModels = news;
     //return View("Index", Configuration.Context());
     return this.Index();
 }
Exemplo n.º 2
0
 public ActionResult CreateNews()
 {
     var command = new CreateNewsCommand { Id = Guid.NewGuid() };
     return View(command);
 }
Exemplo n.º 3
0
 public ActionResult CreateNews(CreateNewsCommand command)
 {
     Configuration.Instance().Bus.Handle(command);
     var news = Configuration.Instance().NewsReadModel.News;
     return View("Index", news);
 }
 public void Handle(CreateNewsCommand command)
 {
     var news = new News(command.Id, command.Title, command.Summary, command.Content);
     _repository.Save(news);
 }