40 lines
926 B
C#
40 lines
926 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Webshop.Domain.Entities;
|
|
|
|
/// <summary>
|
|
/// Details zu den Produktlieferanten.
|
|
/// </summary>
|
|
public class Supplier
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
[Required]
|
|
[MaxLength(255)]
|
|
public string Name { get; set; }
|
|
|
|
[MaxLength(255)]
|
|
public string? ContactPerson { get; set; }
|
|
|
|
[MaxLength(256)]
|
|
[EmailAddress]
|
|
public string? Email { get; set; }
|
|
|
|
[MaxLength(50)]
|
|
[Phone]
|
|
public string? PhoneNumber { get; set; }
|
|
|
|
[ForeignKey(nameof(Address))]
|
|
public Guid? AddressId { get; set; }
|
|
|
|
[MaxLength(1000)]
|
|
public string? Notes { get; set; }
|
|
|
|
// Navigation Properties
|
|
public virtual Address? Address { get; set; }
|
|
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
|
|
} |