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 AssignmentClasses { get; set; } public ICollection AssignmentGroups { get; set; } public ICollection AssignmentAttachments { get; set; } public ICollection Submissions { get; set; } public Assignment() { Id = Guid.NewGuid(); Submissions = new HashSet(); AssignmentGroups = new HashSet(); AssignmentClasses = new HashSet(); AssignmentAttachments = new HashSet(); } } }