using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FMSAdmin.Entities {
    public partial class FmsWorkResultCheckItemMaterial {
        public FmsWorkResultCheckItemMaterial() {
            FmsMaterialRelease = new HashSet<FmsMaterialRelease>();
        }

        public int SiteId { get; set; }
        public int WorkRequestId { get; set; }
        public int CheckItemId { get; set; }
        [Key]
        public int CheckItemMaterialId { get; set; }
        public int MaterialId { get; set; }
        public int MaterialCount { get; set; }
        [StringLength(48)]
        public string MaterialCode { get; set; }
        [StringLength(48)]
        public string Name { get; set; }

        [ForeignKey(nameof(CheckItemId))]
        [InverseProperty(nameof(FmsWorkResultCheckItem.FmsWorkResultCheckItemMaterial))]
        public virtual FmsWorkResultCheckItem CheckItem { get; set; }
        [ForeignKey("SiteId,MaterialId")]
        [InverseProperty("FmsWorkResultCheckItemMaterial")]
        public virtual FmsMaterial FmsMaterial { get; set; }
        [ForeignKey("SiteId,WorkRequestId")]
        [InverseProperty("FmsWorkResultCheckItemMaterial")]
        public virtual FmsWorkResult FmsWorkResult { get; set; }

        [InverseProperty("FmsWorkResultCheckItemMaterial")]
        public virtual ICollection<FmsMaterialRelease> FmsMaterialRelease { get; set; }
    }
}
