public void NewNote(NoteReq noteIn, string email) { DateTime saveUtcNow = DateTime.UtcNow; NoteMod note = new NoteMod(saveUtcNow, email, noteIn.Title, noteIn.Note); _notes.InsertOne(note); }
public int GetNotes([FromBody] NoteReq note) { var model = new Note { Title = note.Title, Content = note.Content }; var user = HttpContext.GetUser(); model.UserId = user.Id; return(new NoteDao().AddNote(model) ? 1 : 0); }
public ActionResult NewNoteJson([FromBody] NoteReq model) { ClaimsIdentity claimsIdentity = User.Identity as ClaimsIdentity; var email = claimsIdentity.FindFirst("user_email").Value; _noteService.NewNote(model, email); return(Ok(new { msg = "New note created!", status = "success" })); }