Examples, like SandwichBot, use Chain.From to return the IDialog<T> for SendAsync, like this:
internal static IDialog<SandwichOrder> MakeRootDialog()
{
return Chain.From(() => FormDialog.FromForm(SandwichOrder.BuildForm));
}
I can see that Chain.From pushes and pops the IFormDialog<T>, returned from FormDialog.FromForm, but am not sure what the benefit of that is. However, the chatbot still works without Chain.From, as shown below:
internal static IDialog<SandwichOrder> MakeRootDialog()
{
return FormDialog.FromForm(SandwichOrder.BuildForm);
}
Since the examples use Chain.From, it makes me think that it might be somehow required or recommended. What is the rationale for Chain.From, where would it be required, and what are the drawbacks to the simpler syntax without it?