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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATXmlTemplateDefinition")]
public partial class AtxmlTemplateDefinition
{
    [Key]
    public int Id { get; set; }

    public int TemplateId { get; set; }

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

    public int FieldSourceId { get; set; }

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

    public int? XmlParentId { get; set; }

    [ForeignKey("FieldSourceId")]
    [InverseProperty("AtxmlTemplateDefinitions")]
    public virtual AtexportType FieldSource { get; set; } = null!;

    [ForeignKey("TemplateId")]
    [InverseProperty("AtxmlTemplateDefinitions")]
    public virtual Attemplate Template { get; set; } = null!;

    [ForeignKey("XmlParentId")]
    [InverseProperty("AtxmlTemplateDefinitions")]
    public virtual AtxmlHierarchyDefinition? XmlParent { get; set; }
}
