I am not that great in c#. But i was trying to understand this code in regards to BOT framework. Here is method
namespace HotelBot.Dialogs
{
[Serializable]
public class GreetingDialog : IDialog
{
public async Task StartAsync(IDialogContext context)
{
await context.PostAsync("I am kiran");
context.Wait(MessageRecievedAsync);
}
public virtual async Task MessageRecievedAsync(IDialogContext context, IAwaitable<IMessageActivity> argument)
{
var message = await argument;
var userName = string.Empty;
context.UserData.TryGetValue<string>("Name", out userName);
if (string.IsNullOrEmpty(userName))
{
await context.PostAsync("What is your name");
userName = message.Text;
context.UserData.SetValue<string>("Name", userName);
}
else
{
await context.PostAsync(string.Format("Hi {0}. How can i help u?" + userName));
}
context.Wait(MessageRecievedAsync);
}
}
}
This line in code calls that method
context.Wait(MessageRecievedAsync); // why no parameters are required
I want to know why parameters are not required for that function to pass?