using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// define a mathematical chapter or thematic
    /// attributes :
    ///     id : identifier in the database
    ///     name : name of the chapter
    /// </summary>
    public class Chapter
    {
        int id;
        string? name;
        //      getters and setters for attributs
        public int Id
        {
            get => id;
            private set { id = value; }
        }
        public string Name
        {
            get => name == null ? "" : name;
            set {  name = value == "" ? null : value; }
        }

        /// <summary>
        /// custructor of a mathematical chapter
        /// </summary>
        /// <param name="name">name of the chapter</param>
        /// <param name="id">id in the database</param>
        public Chapter(string name, int id = 0)
        {
            Name = name;
            Id = id;
        }
    }
}