using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ComputerStoreDatabase.Models;

public class Product
{
    public int Id { get; set; }

    [Required]
    public string Name { get; set; } = string.Empty;

    [Required]
    public string Category { get; set; } = string.Empty;

    [Required]
    public double Price { get; set; }

    public int UserID { get; set; }

    [ForeignKey("UserID")]
    public virtual User User { get; set; } = new();

    [ForeignKey("ProductId")]
    public virtual List<ProductsComponents> ProductsComponents { get; set; } = new();
}
