using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace EveryThing.Models.CodeTable { public enum CodeTableItemType { [Display(Name = "Produkt")] Product = 0, [Display(Name = "Material")] Material = 1 } public class CodeTableItem { [Key] public int IdItem { get; set; } [Required] [ForeignKey("Company")] public int IdCompanyFk { get; set; } [Required] [Display(Name = "Naziv")] public string Title { get; set; } [Display(Name = "Opis")] public string Description { get; set; } [Required] [Display(Name = "Aktiven")] public bool Active { get; set; } [Required] [Display(Name = "Tip")] public CodeTableItemType CodeTableItemType { get; set; } = CodeTableItemType.Product; // ForeignKey public CodeTableCompany Company { get; set; } // InoviceItem [InverseProperty("Item")] public virtual ICollection InvoiceItem { get; set; } } }