journal/Journal.Core/Models/ParsedSection.cs

22 lines
674 B
C#

namespace Journal.Core.Models;
public class ParsedSection
{
public string Title { get; set; }
public List<string> Content { get; set; }
public Dictionary<string, bool> Checkboxes { get; set; }
public ParsedSection(
string title,
IEnumerable<string>? content = null,
IDictionary<string, bool>? checkboxes = null)
{
if (string.IsNullOrWhiteSpace(title))
throw new ArgumentException("Section title is required", nameof(title));
Title = title.Trim();
Content = content is null ? [] : [.. content];
Checkboxes = checkboxes is null ? [] : new Dictionary<string, bool>(checkboxes);
}
}