Files
TechHelper/Entities/Contracts/AssignmentStruct.cs
2025-06-20 15:37:39 +08:00

62 lines
1.4 KiB
C#

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;
using System.Runtime.InteropServices;
namespace Entities.Contracts
{
[Table("assignment_group")]
public class AssignmentStruct
{
[Key]
[Column("id")]
public Guid Id { get; set; }
[Column("assignment")]
[ForeignKey("Assignment")]
public Guid? AssignmentId { get; set; }
[Required]
[Column("title")]
[MaxLength(65535)]
public string Title { get; set; }
[Column("descript")]
[MaxLength(65535)]
public string Description { get; set; }
[Column("layout")]
public Layout Layout { get; set; }
[Column("total_points")]
public float? Score { get; set; }
[Column("index")]
public byte Index { get; set; }
[Column("parent_group")]
public Guid? ParentStructId { get; set; }
[Column("deleted")]
public bool IsDeleted { get; set; } = false;
// Navigation Properties
public Assignment? Assignment { get; set; }
public AssignmentStruct? ParentStruct { get; set;}
public ICollection<AssignmentStruct> ChildrenGroups { get; set; }
public ICollection<AssignmentQuestion> AssignmentQuestions { get; set; }
public AssignmentStruct()
{
Id = Guid.NewGuid();
ChildrenGroups = new HashSet<AssignmentStruct>();
AssignmentQuestions = new HashSet<AssignmentQuestion>();
}
}
}