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

namespace IWS5.DatabaseAccess.IwsDataModels;

[PrimaryKey("ProcessId", "FromEventId", "ToEventId")]
[Table("ATLink")]
[Index("FromEventId", Name = "ATLink_IX_FromEventId")]
[Index("ToEventId", Name = "ATLink_IX_ToEventId")]
public partial class Atlink
{
    [Key]
    [Column("ProcessID")]
    public int ProcessId { get; set; }

    [Key]
    [Column("FromEventID")]
    public int FromEventId { get; set; }

    [Key]
    [Column("ToEventID")]
    public int ToEventId { get; set; }

    [StringLength(255)]
    public string? LinkStyle { get; set; }

    [StringLength(255)]
    public string? Label { get; set; }

    [StringLength(255)]
    public string? LabelStyle { get; set; }

    [ForeignKey("FromEventId")]
    [InverseProperty("AtlinkFromEvents")]
    public virtual AteventDefinition FromEvent { get; set; } = null!;

    [ForeignKey("ProcessId")]
    [InverseProperty("Atlinks")]
    public virtual AtprocessDefinition Process { get; set; } = null!;

    [ForeignKey("ToEventId")]
    [InverseProperty("AtlinkToEvents")]
    public virtual AteventDefinition ToEvent { get; set; } = null!;
}
