1
您好,我已经为这个表格做了检查。Botbuilder,botframework
[Serializable]
public enum PassportFormType
{
someEnum1,
someEnum2,
someEnum3,
}
[Serializable]
public class PassportForm
{
[Prompt("Question text {||}")]
public PassportFormType? Situace { get; set; }
[Prompt("Question text {||}")]
public int Count{ get; set; }
}
我想为我的机器人中的每个枚举类型使用自定义验证。 我知道我可以使用这样的事情
.Field(nameof(Toppings),
validate: async (state, value) =>
{
.
.
.
return result;
})
但它不适合我的解决方案,因为我需要为每个表格一次又一次地使用它。
如何为每个枚举类型应用自定义验证?