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 Component
{
    public int Id { get; set; }

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

    [Required]
    public string Manufacturer { 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("ComponentId")]
    public virtual List<ProductsComponents> ProductsComponents { get; set; } = new();

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