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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATXmlHierarchyDefinition")]
[Index("ParentId", Name = "IX_ATXmlHierarchyDefinition_ParentId")]
public partial class AtxmlHierarchyDefinition
{
    [Key]
    public int Id { get; set; }

    [StringLength(255)]
    public string Name { get; set; } = null!;

    public int Level { get; set; }

    public int? HierarchId { get; set; }

    public int? ParentId { get; set; }

    [InverseProperty("XmlParent")]
    public virtual ICollection<AtxmlTemplateDefinition> AtxmlTemplateDefinitions { get; set; } = new List<AtxmlTemplateDefinition>();

    [ForeignKey("HierarchId")]
    [InverseProperty("AtxmlHierarchyDefinitions")]
    public virtual AtxmlHierarchy? Hierarch { get; set; }

    [InverseProperty("Parent")]
    public virtual ICollection<AtxmlHierarchyDefinition> InverseParent { get; set; } = new List<AtxmlHierarchyDefinition>();

    [ForeignKey("ParentId")]
    [InverseProperty("InverseParent")]
    public virtual AtxmlHierarchyDefinition? Parent { get; set; }
}
