Esempio n. 1
0
 public void AddNote(Note note, int userId)
 {
     if (note == null)
     {
         throw new ArgumentNullException(nameof(note));
     }
     _storage.AddNote(note, userId);
     _events.NotifyAdded(note, userId);
 }
Esempio n. 2
0
        public async Task <StatusCodeResult> Add()
        {
            Note         note = new Note();
            StreamReader sr   = new StreamReader(Request.Body);

            note.text = await sr.ReadToEndAsync();

            _iNotesStorage.AddNote(note);
            return(Ok());
        }