using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
///
/// define a mathematical chapter or thematic
/// attributes :
/// id : identifier in the database
/// name : name of the chapter
///
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; }
}
///
/// custructor of a mathematical chapter
///
/// name of the chapter
/// id in the database
public Chapter(string name, int id = 0)
{
Name = name;
Id = id;
}
}
}