public ActionResult Edit(NoteViewModel model) { NoteDto noteDto = new NoteDto { Id = model.Id, Text = model.Text }; _notesService.EditNote(noteDto); return RedirectToAction("Index"); }
public ActionResult Edit(int id) { var noteDto = _notesService.GetNote(id); var model = new NoteViewModel { Text = noteDto.Text, Id = noteDto.Id }; return View(model); }
public ActionResult Add(NoteViewModel model) { _notesService.AddNote(model.Text); return RedirectToAction("Index"); }
public ActionResult Add() { NoteViewModel model = new NoteViewModel(); return View(model); }