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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATFieldInstanceString")]
[Index("FieldId", Name = "ATFieldInstanceString_IX_FId")]
[Index("FieldName", Name = "ATFieldInstanceString_IX_FName")]
[Index("WorkItemId", Name = "ATFieldInstanceString_IX_WIId")]
public partial class AtfieldInstanceString
{
    [Key]
    [Column("FieldInstanceID")]
    public int FieldInstanceId { get; set; }

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

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

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

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

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

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