C# 如何将简单类型数组传递到规则方法中

C# 如何将简单类型数组传递到规则方法中,c#,codeeffects,C#,Codeeffects,我有一个In-Rule方法,它应该接受一组简单类型,例如字符串类型的数组或整数数组(int16) 我尝试创建以下方法 /* Method with string array*/ [Method(DisplayName = "[M1]")] public int Method1([Parameter(ValueInputType.All)] string[] valStrings ) { return valStri

我有一个In-Rule方法,它应该接受一组简单类型,例如字符串类型的数组或整数数组(int16)

我尝试创建以下方法

/* Method with string array*/
[Method(DisplayName = "[M1]")]
    public int Method1([Parameter(ValueInputType.All)] 
                        string[] valStrings )
    {
        return valStrings.Length; // any calculation goes here
    }
}

/* Method with PARAMS string array*/
[Method(DisplayName = "[M2]")]
    public int Method2([Parameter(ValueInputType.All)] 
                       params string[] valStrings )
    {
        return valStrings.Length; // any calculation goes here
    }
}

/* Method with INT ARRAY referencing on external data source*/
[Method(DisplayName = "[M2]")]
    public int Method2([Parameter(ValueInputType.All,
                        DataSourceName="myDataList" )] 
                       params int[] valInt )
    {
        return valInt; // any calculation goes here
    }
}
codeffect库4.3.2.6似乎不支持将用户输入的参数传递到In-Rule方法中,并且仅使用简单的参数类型限制In-Rule方法,例如Int,而不支持Int[]。似乎无法将DataSource与In-Rule方法连接以将多个项从数据源传递到In-Rule方法。只有用户才能输入简单类型或选择多个数据源项的主要思想是什么我不能限制用户从返回集合的源对象传递源对象字段。


是否有任何建议或解决方法?

CodeEffects在规则方法中支持将IEnumerable类型的字段作为参数。In-rule方法还可以返回IEnumerable集合,包括数组。但是,由于.NET反射中的某些限制,它不能将数组作为参数。代码效果通常也不支持任何类型的数组的用户输入,因为这对开发人员和最终用户来说是一场UI噩梦。更多信息可供选择


您可以使用动态菜单数据源将数据库中的数据作为值或参数使用。可以找到详细信息

因此,即使使用动态菜单数据源,我也无法将任意数量的数据从这些数据源传递到In-Rule方法中?我没有找到任何这样的例子,例如,
public int-MyMethod([Parameter(DataSourceName=“mydata”params int[]ds)]){}