Web-Development-with-Blazor.../Chapter06/MyBlog/Data.Models/Models/BlogPost.cs

15 lines
428 B
C#
Raw Normal View History

2023-02-17 15:28:17 +01:00
namespace Data.Models;
2023-02-17 18:05:56 +01:00
using System.ComponentModel.DataAnnotations;
2023-02-17 15:28:17 +01:00
public class BlogPost
{
public string? Id { get; set; }
2023-02-17 18:05:56 +01:00
[MinLength(5)]
[Required]
2023-02-17 15:28:17 +01:00
public string Title { get; set; } = string.Empty;
2023-02-17 18:05:56 +01:00
[Required]
2023-02-17 15:28:17 +01:00
public string Text { get; set; } = string.Empty;
public DateTime PublishDate { get; set; }
public Category? Category { get; set; }
public List<Tag> Tags { get; set; } = new();
}