26 lines
623 B
C#
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();
|
|||
|
}
|