using System; using System.Collections.Generic; using System.Linq; using BoundaryLab.Domain; namespace BoundaryLab.Application; public interface INoteSession { void Stage(Note note); void Commit(); IReadOnlyList ReadCommitted(); } public sealed class WriteNote(INoteSession session) { public void Stage(string text) { if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Text required", nameof(text)); session.Stage(new Note(text)); } }