From d930693b58ab7b0b01ead4c0ed093dfb20612c5a Mon Sep 17 00:00:00 2001 From: Julien LEICHER Date: Tue, 14 Dec 2021 09:59:36 +0100 Subject: [PATCH] ajout model Comment --- HackerNet.Domain/Comment.cs | 17 +++++++++++++++++ HackerNet.Domain/ICommentRepository.cs | 6 ++++++ 2 files changed, 23 insertions(+) create mode 100644 HackerNet.Domain/Comment.cs create mode 100644 HackerNet.Domain/ICommentRepository.cs diff --git a/HackerNet.Domain/Comment.cs b/HackerNet.Domain/Comment.cs new file mode 100644 index 0000000..418a6f6 --- /dev/null +++ b/HackerNet.Domain/Comment.cs @@ -0,0 +1,17 @@ +namespace HackerNet.Domain; + +public class Comment +{ + public Guid Id { get; } + public Guid LinkId { get; } + public string Content { get; } + public DateTime CreatedAt { get; } + + public Comment(Guid linkId, string content) + { + Id = Guid.NewGuid(); + LinkId = linkId; + Content = content; + CreatedAt = DateTime.UtcNow; + } +} \ No newline at end of file diff --git a/HackerNet.Domain/ICommentRepository.cs b/HackerNet.Domain/ICommentRepository.cs new file mode 100644 index 0000000..b6f3e0f --- /dev/null +++ b/HackerNet.Domain/ICommentRepository.cs @@ -0,0 +1,6 @@ +namespace HackerNet.Domain; + +public interface ICommentRepository +{ + void Add(Comment comment); +} \ No newline at end of file