添加项目文件。
This commit is contained in:
63
Entities/Contracts/Assignment.cs
Normal file
63
Entities/Contracts/Assignment.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Entities.Contracts
|
||||
{
|
||||
[Table("assignments")]
|
||||
public class Assignment
|
||||
{
|
||||
[Key]
|
||||
[Column("id")]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("title")]
|
||||
[StringLength(255)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[Column("description")]
|
||||
public string Description { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("due_date")]
|
||||
public DateTime DueDate { get; set; }
|
||||
|
||||
[Column("total_points")]
|
||||
public decimal? TotalPoints { get; set; }
|
||||
|
||||
[Column("created_by")]
|
||||
[ForeignKey("Creator")]
|
||||
public Guid CreatedBy { get; set; }
|
||||
|
||||
[Column("created_at")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
[Column("updated_at")]
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
[Column("deleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
// Navigation Properties
|
||||
public User Creator { get; set; }
|
||||
public ICollection<AssignmentClass> AssignmentClasses { get; set; }
|
||||
public ICollection<AssignmentGroup> AssignmentGroups { get; set; }
|
||||
public ICollection<AssignmentAttachment> AssignmentAttachments { get; set; }
|
||||
public ICollection<Submission> Submissions { get; set; }
|
||||
|
||||
public Assignment()
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
|
||||
Submissions = new HashSet<Submission>();
|
||||
AssignmentGroups = new HashSet<AssignmentGroup>();
|
||||
AssignmentClasses = new HashSet<AssignmentClass>();
|
||||
AssignmentAttachments = new HashSet<AssignmentAttachment>();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user