コード例 #1
0
ファイル: NoteController.cs プロジェクト: sergioazevedo/ncqrs
        public ActionResult Edit(ChangeNoteText command)
        {
            var service = new MyNotesCommandServiceClient();
            service.ChangeNoteText(command);

            // Return user back to the index that
            // displays all the notes.));
            return RedirectToAction("Index");
        }
コード例 #2
0
ファイル: NoteController.cs プロジェクト: kajaljatakia/ncqrs
        public ActionResult Edit(ChangeNoteText command)
        {
            ChannelHelper.Use(_channelFactory.CreateChannel(), (client) =>
                                client.Execute(new ExecuteRequest(command)));

            // Return user back to the index that
            // displays all the notes.));
            return RedirectToAction("Index", "Note");
        }
コード例 #3
0
ファイル: NoteController.cs プロジェクト: sergioazevedo/ncqrs
        public ActionResult Edit(Guid id)
        {
            NoteItem item;

            using (var context = new ReadModelContainer())
            {
                item = context.NoteItemSet.Single(note => note.Id == id) ;
            }

            var command = new ChangeNoteText();
            command.NoteId = id;
            command.NewText = item.Text;

            return View(command);
        }
コード例 #4
0
 public void ChangeNoteText(ChangeNoteText command)
 {
     _service.Execute(command);
 }