Untitled diff
11 removals
Words removed | 25 |
Total words | 196 |
Words removed (%) | 12.76 |
65 lines
28 additions
Words added | 118 |
Total words | 289 |
Words added (%) | 40.83 |
83 lines
// Create the Bot Framework Adapter with error handling enabled.
// Create the Bot Framework Adapter with error handling enabled.
services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
// Create the storage we'll be using for User and Conversation state. (Memory is great for testing purposes.)
// Create the storage we'll be using for User and Conversation state. (Memory is great for testing purposes.)
services.AddSingleton<IStorage, MemoryStorage>();
services.AddSingleton<IStorage, MemoryStorage>();
// Create the User state. (Used in this bot's Dialog implementation.)
// Create the User state. (Used in this bot's Dialog implementation.)
services.AddSingleton<UserState>();
services.AddSingleton<UserState>();
// Create the Conversation state. (Used by the Dialog system itself.)
// Create the Conversation state. (Used by the Dialog system itself.)
services.AddSingleton<ConversationState>();
services.AddSingleton<ConversationState>();
// Register LUIS recognizer
// The Dialog that will be run by the bot.
services.AddSingleton<FlightBookingRecognizer>();
// Register the BookingDialog.
services.AddSingleton<BookingDialog>();
// The MainDialog that will be run by the bot.
services.AddSingleton<MainDialog>();
services.AddSingleton<MainDialog>();
// Create the bot as a transient. In this case the ASP Controller is expecting an IBot.
// Create the bot as a transient. In this case the ASP Controller is expecting an IBot.
services.AddTransient<IBot, DialogAndWelcomeBot<MainDialog>>();
services.AddTransient<IBot, DialogAndWelcomeBot<MainDialog>>();
}
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
{
if (env.IsDevelopment())
if (env.IsDevelopment())
{
{
app.UseDeveloperExceptionPage();
app.UseDeveloperExceptionPage();
}
}
else
else
{
{
app.UseHsts();
app.UseHsts();
}
}
app.UseDefaultFiles();
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseStaticFiles();
//app.UseHttpsRedirection();
app.UseBotApplicationInsights();
app.UseMvc();
app.UseMvc();
}
}
}
}
}
}