CourseWorkElectronicsShop/ElectronicsShop/ElectronicsShopDataBaseImplement/Models/OrderProduct.cs

27 lines
683 B
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectronicsShopDataBaseImplement.Models
{
public class OrderProduct
{
public int Id { get; set; }
[ForeignKey("OrderID")]
public int OrdersID { get; set; }
[ForeignKey("ProductID")]
public int ProductID { get; set; }
[Required]
public int Count { get; set; }
public virtual Order _order { get; set; } = new();
public virtual Product _product { get; set; } = new();
}
}