Example #1
0
        public bool UpdateNote(Note note)
        {
            bool noteExists = _noteRepository.Exists(n => n.Id == note.Id && n.UserId == UserId);

            if (noteExists)
            {
                note.UserId = UserId;
                _noteRepository.Update(note);
                return true;
            }

            return false;
        }
Example #2
0
 public void AddNote(Note note)
 {
     note.UserId = UserId;
     _noteRepository.Add(note);
 }