myhn/Domain/Link.cs
2021-01-08 16:26:19 +01:00

35 lines
650 B
C#

using System;
using System.Collections.Generic;
namespace MyHN.Domain
{
/// <summary>
/// Représente l'entité lien.
/// </summary>
public class Link : Votable
{
/// public
/// private
/// protected
/// internal
public Guid Id { get; }
public string Url { get; }
public DateTime CreatedAt { get; }
public string CreatedBy { get; }
public Link(string url, string createdBy)
{
Id = Guid.NewGuid();
CreatedAt = DateTime.UtcNow;
CreatedBy = createdBy;
Url = url;
}
public Comment AddComment(string content)
{
return new Comment(Id, content);
}
}
}