Projektdateien hinzufügen.
This commit is contained in:
50
Webshop.Domain/Entities/Customer.cs
Normal file
50
Webshop.Domain/Entities/Customer.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Webshop.Domain.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Für registrierte Nutzer des Webshops. Dies ist die Schnittstelle zu ASP.NET Core Identity.
|
||||
/// </summary>
|
||||
public class Customer
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
// Unique-Constraint und Foreign Key werden via Fluent API konfiguriert
|
||||
[Required]
|
||||
[MaxLength(450)]
|
||||
public string AspNetUserId { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string FirstName { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string LastName { get; set; }
|
||||
|
||||
// Unique-Constraint wird von Identity verwaltet
|
||||
[Required]
|
||||
[MaxLength(256)]
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
|
||||
[MaxLength(20)]
|
||||
[Phone]
|
||||
public string? PhoneNumber { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTimeOffset CreatedDate { get; set; }
|
||||
|
||||
public DateTimeOffset? LastLoginDate { get; set; }
|
||||
|
||||
[Required]
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
// Navigation Properties
|
||||
public virtual ICollection<Address> Addresses { get; set; } = new List<Address>();
|
||||
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
|
||||
public virtual ICollection<Review> Reviews { get; set; } = new List<Review>();
|
||||
}
|
||||
Reference in New Issue
Block a user