mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-04 13:57:37 +00:00
Initial commit
This commit is contained in:
parent
1d9d051759
commit
9656378279
557 changed files with 182300 additions and 0 deletions
|
|
@ -0,0 +1,60 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Xml.Serialization; // [XmlIgnore]
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Packt.Shared
|
||||
{
|
||||
[Index("City", Name = "City")]
|
||||
[Index("CompanyName", Name = "CompanyName")]
|
||||
[Index("PostalCode", Name = "PostalCode")]
|
||||
[Index("Region", Name = "Region")]
|
||||
public partial class Customer
|
||||
{
|
||||
public Customer()
|
||||
{
|
||||
Orders = new HashSet<Order>();
|
||||
CustomerTypes = new HashSet<CustomerDemographic>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
[StringLength(5)]
|
||||
[RegularExpression("[A-Z]{5}")]
|
||||
[Required]
|
||||
public string CustomerId { get; set; } = null!;
|
||||
|
||||
[StringLength(40)]
|
||||
[Required]
|
||||
public string CompanyName { get; set; } = null!;
|
||||
|
||||
[StringLength(30)]
|
||||
public string? ContactName { get; set; }
|
||||
[StringLength(30)]
|
||||
public string? ContactTitle { get; set; }
|
||||
[StringLength(60)]
|
||||
public string? Address { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? City { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Region { get; set; }
|
||||
[StringLength(10)]
|
||||
public string? PostalCode { get; set; }
|
||||
[StringLength(15)]
|
||||
public string? Country { get; set; }
|
||||
[StringLength(24)]
|
||||
public string? Phone { get; set; }
|
||||
[StringLength(24)]
|
||||
public string? Fax { get; set; }
|
||||
|
||||
[InverseProperty("Customer")]
|
||||
[XmlIgnore]
|
||||
public virtual ICollection<Order> Orders { get; set; }
|
||||
|
||||
[ForeignKey("CustomerId")]
|
||||
[InverseProperty("Customers")]
|
||||
[XmlIgnore]
|
||||
public virtual ICollection<CustomerDemographic> CustomerTypes { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue