Skip to content

Instantly share code, notes, and snippets.

@jamesmundy
Last active November 19, 2018 23:56
Show Gist options
  • Save jamesmundy/bc8ea2b10d39dfea2ec3f4ee99682c9c to your computer and use it in GitHub Desktop.
Save jamesmundy/bc8ea2b10d39dfea2ec3f4ee99682c9c to your computer and use it in GitHub Desktop.
Deserializes requests and returns dialogs
// Deserialize the incoming activity
string jsonContent = await req.Content.ReadAsStringAsync();
var activity = JsonConvert.DeserializeObject<Activity>(jsonContent);
if (activity != null)
{
if (activity.Type == ActivityTypes.Message)
await Conversation.SendAsync(activity,() =>
new NewPostcardDialog(Conversation.Container.Resolve<IAppSettingsService>(),
Conversation.Container.Resolve<IPaypalService>(),
Conversation.Container.Resolve<ITableService>(),
Conversation.Container.Resolve<IBugTrackingService>(),
Conversation.Container.Resolve<IAnalyticsService>()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment