InventoryManager / Models / Products.cs
Products.cs
Raw
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace InventoryManager.Models
{

    public class Products
    {
        [Key]
        public int Id { get; set; }

        [Required]
        [StringLength(25)]
        public string Name { get; set; }

        [Required]
        [StringLength(75)]
        public string Description { get; set; }

        [Required]
        [ForeignKey("Colors")]
        public int? Color { get; set; }

        public virtual Colors Colors { get; set; }

        [Required]
        [StringLength(25)]
        [DisplayName("Qty")]
        public string Quantity { get; set; }

        [Required]
        [ForeignKey("Units")]
        public int Unit { get; set; }

        public virtual Unit Units { get; set; }

        [Required]
        [ForeignKey("Collections")]
        public int Collection { get; set; }

        public virtual Collections Collections { get; set; }

        [Required]
        [ForeignKey("Materials")]
        public int Material { get; set; }

        public virtual Materials Materials { get; set; }
    }
}