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

namespace AsbCloudDb.Model
{
    [Table("t_drilling_program_part"), Comment("части программ бурения")]
    public class DrillingProgramPart
    {
        [Key]
        [Column("id")]
        public int Id { get; set; }

        [Column("id_well")]
        public int IdWell { get; set; }

        [Column("id_file_category")]
        public int IdFileCategory { get; set; }

        [ForeignKey(nameof(IdWell))]
        public Well Well { get; set; } = null!;

        [ForeignKey(nameof(IdFileCategory))]
        public FileCategory FileCategory { get; set; } = null!;

        [InverseProperty(nameof(RelationUserDrillingProgramPart.DrillingProgramPart))]
        public virtual ICollection<RelationUserDrillingProgramPart> RelatedUsers { get; set; } = null!;
    }
}