コード例 #1
0
        public void EditNote(EditNoteReq noteIn, string email)
        {
            DateTime saveUtcNow = DateTime.UtcNow;
            NoteMod  note       = new NoteMod(noteIn.note_id, saveUtcNow, email, noteIn.Title, noteIn.Note);

            _notes.ReplaceOne(note => note.Id == noteIn.note_id && note.Email == email, note);
        }
コード例 #2
0
        public ActionResult EditNoteJson([FromBody] EditNoteReq model)
        {
            ClaimsIdentity claimsIdentity = User.Identity as ClaimsIdentity;

            var email = claimsIdentity.FindFirst("user_email").Value;

            _noteService.EditNote(model, email);

            return(Ok(new { msg = "Note successfully edited!", status = "success" }));
        }