-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathOrderDetail.cs
37 lines (29 loc) · 1004 Bytes
/
OrderDetail.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
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Northwind.EntityModels;
[PrimaryKey("OrderId", "ProductId")]
[Table("Order Details")]
[Index("OrderId", Name = "OrderId")]
[Index("OrderId", Name = "OrdersOrder_Details")]
[Index("ProductId", Name = "ProductId")]
[Index("ProductId", Name = "ProductsOrder_Details")]
public partial class OrderDetail
{
[Key]
public int OrderId { get; set; }
[Key]
public int ProductId { get; set; }
[Column(TypeName = "money")]
public decimal UnitPrice { get; set; }
public short Quantity { get; set; }
public float Discount { get; set; }
[ForeignKey("OrderId")]
[InverseProperty("OrderDetails")]
public virtual Order Order { get; set; } = null!;
[ForeignKey("ProductId")]
[InverseProperty("OrderDetails")]
public virtual Product Product { get; set; } = null!;
}