Uebungsaufgaben/Semester3/DotNET/Aufgabenblatt5/Aufgabe14/Customer.cs

26 lines
623 B
C#
Raw Permalink Normal View History

2024-12-19 22:55:07 +00:00
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();
}