LANCommander/LANCommander.Server.Data/Models/Script.cs
Pat Hartl 217fcfa0b6 Merge branch 'main' into release/2.2.0
# Conflicts:
#	LANCommander.Server.Services/ActionService.cs
#	LANCommander.Server.Services/SavePathService.cs
2026-07-22 17:13:51 -05:00

49 lines
1.5 KiB
C#

using LANCommander.SDK.Enums;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace LANCommander.Server.Data.Models
{
[Table("Scripts")]
public class Script : BaseModel
{
[Required]
public string Name { get; set; }
public string? Description { get; set; }
public ScriptType Type { get; set; }
public string Contents { get; set; }
public bool RequiresAdmin { get; set; }
public RuntimePlatform Platforms { get; set; }
public Guid? GameId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(GameId))]
[InverseProperty("Scripts")]
public Game? Game { get; set; }
public Guid? RedistributableId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(RedistributableId))]
[InverseProperty("Scripts")]
public Redistributable? Redistributable { get; set; }
public Guid? ToolId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(ToolId))]
[InverseProperty("Scripts")]
public Tool? Tool { get; set; }
public Guid? ServerId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(ServerId))]
[InverseProperty("Scripts")]
public Server? Server { get; set; }
public Guid? GameVersionId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(GameVersionId))]
[InverseProperty(nameof(GameVersion.Scripts))]
public GameVersion? GameVersion { get; set; }
}
}