using System; using System.Collections.Generic; namespace HN.Domain { public sealed class Link { public Guid Id { get; } public string Url { get; } public DateTime CreatedAt { get; } private List _votes; public IReadOnlyList Votes { get { return _votes; } } private Link(string url) { this.Id = Guid.NewGuid(); this.CreatedAt = DateTime.UtcNow; this.Url = url; this._votes = new List(); } public static Link FromUrl(string url) { return new Link(url); } } }