public async Task <Note> PutNotes(Note notes) { _context.Note.Update(notes); await _context.SaveChangesAsync(); return(notes); }
public async Task <IActionResult> AddNote([FromBody] Notes note) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _notesContext.notes.Add(note); await _notesContext.SaveChangesAsync(); return(CreatedAtAction("GetNotes", new { id = note.Id }, note)); }