Ejemplo n.º 1
0
        public async Task <IHttpActionResult> PostNote(NoteDto newNote)
        {
            ServiceResponse <GetNoteDto> response = await _noteService.AddNewNote(newNote);

            if (response.Success)
            {
                return(Ok(response));
            }
            return(Ok(response));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> CreateNote([FromBody] AddNewNoteRequest newNote)
        {
            var result = await _noteService.AddNewNote(newNote);

            if (!result)
            {
                return(BadRequest());
            }
            return(Ok());
        }
        public async Task <IActionResult> AddNote([FromBody] AddNoteViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            await _noteService.AddNewNote(model);

            return(CreatedAtAction("GetNotes", new { id = model.NoteId }));
        }