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(); }
public ActionResult CreateNews() { var command = new CreateNewsCommand { Id = Guid.NewGuid() }; return View(command); }
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); }