【发布时间】:2019-12-23 12:14:20
【问题描述】:
因此,我使用 C# 中的 Azure BotFramework 创建了一个机器人并下载了源代码。代码位于 .NET Core V 2.1
现在我想通过将聊天机器人连接到数据库来自定义聊天机器人,为此我创建了一个类 DAL.cs,添加一个类后,startup.cs 文件在 ConfigureServices 中引发错误
'EchoBot' 是一个命名空间,但用作类型
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
// Create the Bot Framework Adapter.
services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
// Create the bot as a transient. In this case the ASP Controller is expecting an IBot.
services.AddTransient<IBot, EchoBot>();
}
如何将其连接到数据库?
【问题讨论】:
标签: c# botframework asp.net-core-2.1