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

namespace InventoryManager.Models
{

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

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

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

        [Required]
        [ForeignKey("Suppliers")]
        public int Supplier { get; set; }

        public virtual Suppliers Suppliers { get; set; }
    

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

        public virtual Unit Units { get; set; }
    }
}