public async Task <IActionResult> Create(CreateNoteViewModel noteViewModel) { try { if (ModelState.IsValid) { var note = _mapper.Map <NoteModel>(noteViewModel); await _notesService.CreateNote(note); return(RedirectToAction("Index")); } } catch { } return(View("Index", noteViewModel)); }
public ActionResult Create(ViewModels.Notes.NotesListItemViewModel note) { _notesService.CreateNote(note.Text, User.Identity.Name); return(RedirectToAction("Index")); }
public NotesDto SaveNote([FromBody] NotesDto model) { return(_notesService.CreateNote(model)); }
public async Task <IActionResult> CreateFolders([FromBody] NotesDto notesDto) => Ok(await _notesService.CreateNote(notesDto));