delegateas / ExpressionEngine

Expression Engine for Power Automate expressions written in C# using Sprache!
MIT License
8 stars 3 forks source link

Feature: Implicit Conversions/Cast on ValueContainer #56

Open pksorensen opened 2 years ago

pksorensen commented 2 years ago

Would be nice to have implicit casts / conversions for ValueContainer, simplifying constructing a ValueContainer like below:


        public override ValueTask<ValueContainer> ExecuteFunction(params ValueContainer[] parameters)
        {
            var relationship = parameters[0]?.ToString();

            return new ValueTask<ValueContainer>(new ValueContainer(relationship));

        }

with implicit conversions between simple types and ValueContainer one might do this instead

        public override ValueTask<ValueContainer> ExecuteFunction(params ValueContainer[] parameters)
        {
            var relationship = parameters[0]?.ToString();

            return new ValueTask<ValueContainer>(relationship);

        }