2022-05-23 08:53:44 +02:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2022-06-23 12:54:54 +02:00
|
|
|
|
using System.Text.Json.Serialization;
|
2022-05-23 08:53:44 +02:00
|
|
|
|
|
|
|
|
|
namespace Aps_Single_Page_Anwendung.Models
|
2022-05-17 12:26:45 +02:00
|
|
|
|
{
|
|
|
|
|
public class Speise
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
2022-05-27 07:44:42 +02:00
|
|
|
|
|
2022-06-07 14:35:06 +02:00
|
|
|
|
[Required] // Leere Felder sind damit nicht möglich, kein null möglich
|
|
|
|
|
[MaxLength(100)] // Vermeidet bei des Feldes in der Tabelle ein varchar(Max)
|
2022-05-17 12:26:45 +02:00
|
|
|
|
public string Name { get; set; }
|
2022-06-07 14:35:06 +02:00
|
|
|
|
|
|
|
|
|
[MaxLength(255)]
|
2022-05-17 12:26:45 +02:00
|
|
|
|
public string Beschreibung { get; set; }
|
2022-05-27 07:44:42 +02:00
|
|
|
|
|
|
|
|
|
[Range(0,25)] // Preis darf nur zwischen 0 und 25 Euro sein
|
2022-05-17 12:26:45 +02:00
|
|
|
|
public double Preis { get; set; }
|
2022-05-27 07:44:42 +02:00
|
|
|
|
|
2022-05-17 12:26:45 +02:00
|
|
|
|
public int KategorieId { get; set; }
|
2022-06-23 12:54:54 +02:00
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
2022-05-17 12:26:45 +02:00
|
|
|
|
public Kategorie Kategorie { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|