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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATFieldInstanceOption")]
[Index("FieldId", Name = "ATFieldInstanceOption_IX_FId")]
[Index("FieldName", Name = "ATFieldInstanceOption_IX_FName")]
[Index("WorkItemId", Name = "ATFieldInstanceOption_IX_WIId")]
public partial class AtfieldInstanceOption
{
    [Key]
    [Column("FieldInstanceID")]
    public int FieldInstanceId { get; set; }

    [Column("FieldID")]
    public int FieldId { get; set; }

    public string? FieldValue { get; set; }

    [Column("WorkItemID")]
    public int WorkItemId { get; set; }

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

    [ForeignKey("FieldId")]
    [InverseProperty("AtfieldInstanceOptions")]
    public virtual AtfieldDefinition Field { get; set; } = null!;

    [ForeignKey("WorkItemId")]
    [InverseProperty("AtfieldInstanceOptions")]
    public virtual AtworkItem WorkItem { get; set; } = null!;
}
