namespace ScadaLink.Commons.Entities.Scripts;
public class SharedScript
{
/// Primary key.
public int Id { get; set; }
/// Unique script name used to reference this script from templates.
public string Name { get; set; }
/// C# script source code.
public string Code { get; set; }
/// JSON-serialized parameter definitions, or null when the script takes no parameters.
public string? ParameterDefinitions { get; set; }
/// JSON-serialized return type definition, or null when the script has no return value.
public string? ReturnDefinition { get; set; }
///
/// Initializes a new shared script with the required name and code.
///
/// Unique script name.
/// C# script source code.
public SharedScript(string name, string code)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
Code = code ?? throw new ArgumentNullException(nameof(code));
}
}