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

namespace IWS5.DatabaseAccess.IwsDataModels;

[PrimaryKey("WorkItemRef", "EventId")]
[Table("ATStack")]
[Index("WorkItemRef", "SubProcessId", Name = "IX_ATStack", IsUnique = true)]
public partial class Atstack
{
    [Key]
    public int WorkItemRef { get; set; }

    [Key]
    public int EventId { get; set; }

    public int SubProcessId { get; set; }

    [ForeignKey("EventId")]
    [InverseProperty("Atstacks")]
    public virtual AteventDefinition Event { get; set; } = null!;

    [ForeignKey("SubProcessId")]
    [InverseProperty("Atstacks")]
    public virtual AtprocessDefinition SubProcess { get; set; } = null!;

    [ForeignKey("WorkItemRef")]
    [InverseProperty("Atstacks")]
    public virtual AtworkItemReference WorkItemRefNavigation { get; set; } = null!;
}
