bulletboards/ImageBoardServerApp/Data/CommentData.cs

44 lines
1,015 B
C#
Raw Normal View History

2023-01-18 12:56:24 +00:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics.CodeAnalysis;
2023-01-18 12:56:24 +00:00
using ImageBoardServerApp.Shared.Components;
namespace ImageBoardServerApp.Data;
public class CommentData
{
[Required]
[DatabaseGenerated((DatabaseGeneratedOption.Identity))]
[Key]
public int CommentID { get; set; }
[Required]
public int PostID { get; set; }
//[ForeignKey("PostID")]
public virtual PostData Post { get; set; }
[Required]
public int UserID { get; set; }
//[ForeignKey("UserID")]
2023-01-26 08:07:25 +00:00
public virtual UserData User { get; set; }
2023-01-18 12:56:24 +00:00
//[ForeignKey("ImageID")]
public virtual ImageData? Image { get; set; }
public int? ImageID { get; set; }
2023-01-18 12:56:24 +00:00
[Required]
public string Content { get; set; }
[Required]
public string Username { get; set; }
[Required]
public string Board { get; set; }
2023-01-25 22:45:36 +00:00
[Required]
public long CreatedAt { get; set; }
2023-01-18 12:56:24 +00:00
}