public bool DeleteNote(int userId, Note note) { bool result = false; using (NoteManager manager = new NoteManager()) { if (manager.ValidateNoteOwner(userId, note.Id)) result = manager.Delete(note.Id); } return result; }
public Note GetNoteById(int userId, int noteId) { Note result = null; using (NoteManager manager = new NoteManager()) { if (manager.ValidateNoteOwner(userId, noteId)) result = manager.GetById(noteId); } return result; }
public Note UpdateNote(int userId, Note note) { Note result = null; using (NoteManager manager = new NoteManager()) { if (manager.ValidateNoteOwner(userId, note.Id)) result = manager.Update(note); } return result; }