using System.ComponentModel.DataAnnotations;

namespace BlogPlatform.Models;

public class Post
{
    [Key] public int Id { get; set; }
    [Required, Length(1,200)] public string? Title { get; set; }
    [Required] public string? Content { get; set; }
    [Required] public int Likes { get; set; }
    public DateOnly CreatedAt  { get; set; }
    
    public List<Comment>? Comments { get; set; }
    
    [Required] public int UserId { get; set; }
    public User? User{ get; set; }
}