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));
        }
예제 #2
0
        public ActionResult Create(ViewModels.Notes.NotesListItemViewModel note)
        {
            _notesService.CreateNote(note.Text, User.Identity.Name);

            return(RedirectToAction("Index"));
        }
예제 #3
0
 public NotesDto SaveNote([FromBody] NotesDto model)
 {
     return(_notesService.CreateNote(model));
 }
 public async Task <IActionResult> CreateFolders([FromBody] NotesDto notesDto) => Ok(await _notesService.CreateNote(notesDto));