From fa18aa5afd390b863eb2847b077a971854f25391 Mon Sep 17 00:00:00 2001 From: Thyge Skoedt Steffensen <31892312+thygesteffensen@users.noreply.github.com> Date: Sun, 28 Feb 2021 12:59:35 +0100 Subject: [PATCH] feat: added create array function --- .../CreateArrayFunction.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 PowerAutomateMockUp/ExpressionParser/Functions/Implementations/ConversionFunctions/CreateArrayFunction.cs diff --git a/PowerAutomateMockUp/ExpressionParser/Functions/Implementations/ConversionFunctions/CreateArrayFunction.cs b/PowerAutomateMockUp/ExpressionParser/Functions/Implementations/ConversionFunctions/CreateArrayFunction.cs new file mode 100644 index 0000000..4275794 --- /dev/null +++ b/PowerAutomateMockUp/ExpressionParser/Functions/Implementations/ConversionFunctions/CreateArrayFunction.cs @@ -0,0 +1,23 @@ +using System.Linq; +using Parser.ExpressionParser.Functions.Base; +using Parser.ExpressionParser.Functions.CustomException; + +namespace Parser.ExpressionParser.Functions.Implementations.ConversionFunctions +{ + public class CreateArrayFunction : Function + { + public CreateArrayFunction() : base("createArray") + { + } + + public override ValueContainer ExecuteFunction(params ValueContainer[] parameters) + { + if (parameters.Length == 0) + { + throw InvalidTemplateException.BuildInvalidLanguageFunction("SomeActon", "createArray"); + } + + return new ValueContainer(parameters.ToList()); + } + } +} \ No newline at end of file