ex-col-04-training/exam_cal_mgmt/ExamCalendar/Model.cs
github-classroom[bot] 3723fffef2
Initial commit
2025-01-02 16:34:36 +00:00

34 lines
No EOL
1 KiB
C#

namespace ExamCalendar;
/// <summary>
/// Represents an exam for a specific subject scheduled for a specific date.
/// </summary>
/// <param name="Subject">Subject in which the exam will be taken</param>
/// <param name="Date">Planned date of the exam</param>
/// <param name="Teacher">Teacher grading the exam</param>
public record Exam(string? Subject, DateTime Date, string Teacher);
/// <summary>
/// Represents a node which can be linked together with other nodes to create a list
/// </summary>
public sealed class Node
{
/// <summary>
/// Creates a new instance of the <see cref="Node"/> class
/// </summary>
/// <param name="exam">The exam to handle with this node</param>
public Node(Exam exam)
{
Data = exam;
}
/// <summary>
/// Gets the exam contained within the node
/// </summary>
public Exam Data { get; }
/// <summary>
/// Gets or sets the next pointer of the node
/// </summary>
public Node? Next { get; set; }
}