-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArticle.cs
48 lines (36 loc) · 1.16 KB
/
Article.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Intillegio.Common.Constants;
namespace Intillegio.Models
{
public class Article : BaseId
{
public Article()
{
Comments = new HashSet<Comment>();
}
[Required]
[StringLength(LengthConstants.MaxLength, MinimumLength = LengthConstants.NameMinLength)]
public string Name { get; set; }
[Required]
public string Content { get; set; }
[Required]
public int CategoryId { get; set; }
public Category CategoryName { get; set; }
public string VideoLink { get; set; }
[Required]
public string Image65X65 { get; set; }
[Required]
public string Image350X220 { get; set; }
[Required]
public string Image390X245 { get; set; }
public string VideoImage400X250 { get; set; }
[Required]
public string Image825X530 { get; set; }
[Required]
[DataType(DataType.Date)]
public DateTime Date { get; set; } = DateTime.UtcNow;
public ICollection<Comment> Comments { get; set; }
}
}