-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathOrder.cs
74 lines (55 loc) · 2.01 KB
/
Order.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Northwind.EntityModels;
[Index("CustomerId", Name = "CustomerId")]
[Index("CustomerId", Name = "CustomersOrders")]
[Index("EmployeeId", Name = "EmployeeId")]
[Index("EmployeeId", Name = "EmployeesOrders")]
[Index("OrderDate", Name = "OrderDate")]
[Index("ShipPostalCode", Name = "ShipPostalCode")]
[Index("ShippedDate", Name = "ShippedDate")]
[Index("ShipVia", Name = "ShippersOrders")]
public partial class Order
{
[Key]
public int OrderId { get; set; }
[StringLength(5)]
[RegularExpression("[A-Z]{5}")]
public string? CustomerId { get; set; }
public int? EmployeeId { get; set; }
[Column(TypeName = "datetime")]
public DateTime? OrderDate { get; set; }
[Column(TypeName = "datetime")]
public DateTime? RequiredDate { get; set; }
[Column(TypeName = "datetime")]
public DateTime? ShippedDate { get; set; }
public int? ShipVia { get; set; }
[Column(TypeName = "money")]
public decimal? Freight { get; set; }
[StringLength(40)]
public string? ShipName { get; set; }
[StringLength(60)]
public string? ShipAddress { get; set; }
[StringLength(15)]
public string? ShipCity { get; set; }
[StringLength(15)]
public string? ShipRegion { get; set; }
[StringLength(10)]
public string? ShipPostalCode { get; set; }
[StringLength(15)]
public string? ShipCountry { get; set; }
[ForeignKey("CustomerId")]
[InverseProperty("Orders")]
public virtual Customer? Customer { get; set; }
[ForeignKey("EmployeeId")]
[InverseProperty("Orders")]
public virtual Employee? Employee { get; set; }
[InverseProperty("Order")]
public virtual ICollection<OrderDetail> OrderDetails { get; set; } = new List<OrderDetail>();
[ForeignKey("ShipVia")]
[InverseProperty("Orders")]
public virtual Shipper? ShipViaNavigation { get; set; }
}