From 5a201fd565251429c01d90c0362c6b90db9e212f Mon Sep 17 00:00:00 2001 From: limited_dev Date: Tue, 13 Jun 2023 07:48:14 +0200 Subject: [PATCH] feat: added shouldAnon to PostData.cs and CommentData.cs Signed-off-by: limited_dev --- ImageBoardServerApp/Data/CommentData.cs | 43 ++++++++++------------ ImageBoardServerApp/Data/PostData.cs | 47 +++++++++++-------------- 2 files changed, 40 insertions(+), 50 deletions(-) diff --git a/ImageBoardServerApp/Data/CommentData.cs b/ImageBoardServerApp/Data/CommentData.cs index fff66be..f61c1c5 100644 --- a/ImageBoardServerApp/Data/CommentData.cs +++ b/ImageBoardServerApp/Data/CommentData.cs @@ -9,38 +9,33 @@ public class CommentData [DatabaseGenerated((DatabaseGeneratedOption.Identity))] [Key] public int CommentID { get; set; } - - [Required] - public int PostID { get; set; } - + + [Required] public int PostID { get; set; } + //[ForeignKey("PostID")] public virtual PostData Post { get; set; } - [Required] - public int UserID { get; set; } - + [Required] public int UserID { get; set; } + //[ForeignKey("UserID")] public virtual UserData User { get; set; } - + //[ForeignKey("ImageID")] public virtual ImageData? Image { get; set; } - + public int? ImageID { get; set; } - - [Required] - public string Content { get; set; } - - [Required] - public string Username { get; set; } - - [Required] - public string Board { get; set; } - - [Required] - public long CreatedAt { get; set; } - + + [Required] public string Content { get; set; } + + [Required] public string Username { get; set; } + + [Required] public string Board { get; set; } + + [Required] public long CreatedAt { get; set; } + public ReportData? Report { get; set; } - + public int GET { get; set; } - + + public bool shouldAnon { get; set; } } \ No newline at end of file diff --git a/ImageBoardServerApp/Data/PostData.cs b/ImageBoardServerApp/Data/PostData.cs index 1ba078d..845aaf6 100644 --- a/ImageBoardServerApp/Data/PostData.cs +++ b/ImageBoardServerApp/Data/PostData.cs @@ -10,42 +10,37 @@ public class PostData [Key] public int PostID { get; set; } - [Required] - public int UserID { get; set; } - + [Required] public int UserID { get; set; } + //[ForeignKey("UserID")] public UserData User { get; set; } - - [Required] - public int ImageID { get; set; } - + + [Required] public int ImageID { get; set; } + //[ForeignKey("ImageID")] public ImageData Image { get; set; } - [Required] - public string Username { get; set; } - - [Required] - public string Title { get; set; } - - [Required] - public string Content { get; set; } - + [Required] public string Username { get; set; } + + [Required] public string Title { get; set; } + + [Required] public string Content { get; set; } + public int Interactions { get; set; } - - [Required] - public long CreatedAt { get; set; } - - [Required] - public string Board { get; set; } - + + [Required] public long CreatedAt { get; set; } + + [Required] public string Board { get; set; } + public List Comments { get; set; } - + public ReportData? Report { get; set; } public bool IsSticky { get; set; } - + public bool IsLocked { get; set; } - + public int GET { get; set; } + + public bool shouldAnon { get; set; } } \ No newline at end of file