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;
})
但它不適合我的解決方案,因爲我需要爲每個表格一次又一次地使用它。
如何爲每個枚舉類型應用自定義驗證?