Projektdateien hinzufügen.
This commit is contained in:
56
Webshop.Domain/Entities/Adress.cs
Normal file
56
Webshop.Domain/Entities/Adress.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Webshop.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Verwendet für Kundenadressen, Rechnungs- und Lieferadressen von Bestellungen oder Lieferanten.
|
||||
/// </summary>
|
||||
public class Address
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[ForeignKey(nameof(Customer))]
|
||||
public Guid? CustomerId { get; set; }
|
||||
|
||||
[MaxLength(50)]
|
||||
public string? AddressType { get; set; } // z.B. "Billing", "Shipping"
|
||||
|
||||
[Required]
|
||||
[MaxLength(255)]
|
||||
public string Street { get; set; }
|
||||
|
||||
[MaxLength(255)]
|
||||
public string? Street2 { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string City { get; set; }
|
||||
|
||||
[MaxLength(100)]
|
||||
public string? State { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(20)]
|
||||
public string PostalCode { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string Country { get; set; }
|
||||
|
||||
[MaxLength(255)]
|
||||
public string? CompanyName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string LastName { get; set; }
|
||||
|
||||
// Navigation Property
|
||||
public virtual Customer? Customer { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user