public void AddNote(Note note, int userId) { if (note == null) { throw new ArgumentNullException(nameof(note)); } _storage.AddNote(note, userId); _events.NotifyAdded(note, userId); }
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()); }