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

namespace IWS5.DatabaseAccess.IwsDataModels;

[Table("ATSearch")]
public partial class Atsearch
{
    [Key]
    public int SearchId { get; set; }

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

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

    public int? Type { get; set; }

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

    [Column(TypeName = "datetime")]
    public DateTime? LastRun { get; set; }

    [Column("SQLString")]
    [StringLength(1024)]
    public string? Sqlstring { get; set; }

    public byte? PublicSearch { get; set; }

    [StringLength(50)]
    public string? SortField { get; set; }

    public int? SortDirection { get; set; }

    public Guid? ObjectId { get; set; }

    public Guid? SearchRegistrationGuid { get; set; }

    [ForeignKey("SearchRegistrationGuid")]
    [InverseProperty("Atsearches")]
    public virtual AtsearchRegistration? SearchRegistration { get; set; }
}
