You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Model
|
|
{
|
|
public class Chapter
|
|
{
|
|
/// <summary>
|
|
/// define a mathematical chapter or thematic
|
|
/// attributes :
|
|
/// id : identifier in the database
|
|
/// name : name of the chapter
|
|
/// </summary>
|
|
int id;
|
|
string? name;
|
|
/// <summary>
|
|
/// getters and setters for attributs
|
|
/// </summary>
|
|
public int? Id
|
|
{
|
|
get => id == -1 ? null : id ;
|
|
private set { id = value == null || value < -1 ? -1 : value.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 = null)
|
|
{
|
|
Name = name;
|
|
Id = id;
|
|
}
|
|
}
|
|
} |