Uebungsaufgaben/Semester3/DotNET/Aufgabenblatt5/Aufgabe14/Customer.cs
2024-12-19 23:55:07 +01:00

26 lines
623 B
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics.CodeAnalysis;
namespace Aufgabe14;
[Table("Customers")]
public class Customer
{
[NotNull] // Unterschied Required?
[Column(TypeName = "varchar(100)")]
public string Firstname { get; set; }
[NotNull]
// [Column(TypeName = "varchar(100)")] Wie geht das?
[Column("Lastname")]
public string Surname { get; set; }
[Key]
public int Id { get; set; }
[NotNull]
public Gender Gender { get; set; }
public Address Address { get; set; } = new Address();
}