26 lines
653 B
C#
26 lines
653 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace LittleShop.Models;
|
|
|
|
public class OrderItem
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid OrderId { get; set; }
|
|
|
|
public Guid ProductId { get; set; }
|
|
|
|
public int Quantity { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,2)")]
|
|
public decimal UnitPrice { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,2)")]
|
|
public decimal TotalPrice { get; set; }
|
|
|
|
// Navigation properties
|
|
public virtual Order Order { get; set; } = null!;
|
|
public virtual Product Product { get; set; } = null!;
|
|
} |