Codeeffects RuleEngine:方法数据源参数,类型为字符串
Codeffects RuleEngine: Method Datasource parameter with type string
我想请你帮忙定义方法参数。
我有这个方法定义:
[Method("Date from DataField")]
public DateTime DateTimeFromDataField([Parameter(DataSourceName = DataSourceHolders.InputTemplatesDataTreeSource, ValueInputType = ValueInputType.All)] string nodeKey)
{
/* some return code */
}
我的问题是我的参数带有数据源类型字符串。该参数被忽略。我找到了您文档的这一部分:
• DataSourceName Type :
System.String Used only in rule action or
in-rule method parameters that represent System.Int parameters of
qualified .NET methods, and is ignored for parameters of other types.
Gets or sets the unique name of the Dynamic Menu Data Source declared
by the SourceAttribute on the source object. If set, the rule author
can only select the value from the menu of items supplied by the data
source method.
请问是否有其他解决方案如何将字符串值作为数据源参数传递?
Code Effects 规则编辑器不支持菜单数据源中的字符串 ID。您始终可以将自动递增列添加到 table 并使用它代替字符串 ID。这是用整数替换字符串的最常见方法。
我想请你帮忙定义方法参数。
我有这个方法定义:
[Method("Date from DataField")]
public DateTime DateTimeFromDataField([Parameter(DataSourceName = DataSourceHolders.InputTemplatesDataTreeSource, ValueInputType = ValueInputType.All)] string nodeKey)
{
/* some return code */
}
我的问题是我的参数带有数据源类型字符串。该参数被忽略。我找到了您文档的这一部分:
• DataSourceName Type : System.String Used only in rule action or in-rule method parameters that represent System.Int parameters of qualified .NET methods, and is ignored for parameters of other types. Gets or sets the unique name of the Dynamic Menu Data Source declared by the SourceAttribute on the source object. If set, the rule author can only select the value from the menu of items supplied by the data source method.
请问是否有其他解决方案如何将字符串值作为数据源参数传递?
Code Effects 规则编辑器不支持菜单数据源中的字符串 ID。您始终可以将自动递增列添加到 table 并使用它代替字符串 ID。这是用整数替换字符串的最常见方法。