-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMaterial.cs
More file actions
30 lines (26 loc) · 905 Bytes
/
Material.cs
File metadata and controls
30 lines (26 loc) · 905 Bytes
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
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static CourseNet.Common.DataConstants.Material;
namespace CourseNet.Data.Models.Entities
{
[Comment("Material Table")]
public class Material
{
[Comment("Material Identifier")]
public int Id { get; set; }
[Comment("Material Name")]
[Required]
[MaxLength(NameMaxLength)]
public string Name { get; set; } = string.Empty;
[Comment("Material Description")]
[Required]
[MaxLength(DescriptionMaxLength)]
public string Description { get; set; } = string.Empty;
[Comment("Lecture identifier")]
public int LectureId { get; set; }
[Comment("Lecture")]
[ForeignKey(nameof(LectureId))]
public virtual Lecture Lecture { get; set; }
}
}