Messages 4中的MessagesController:ApiController在哪里?

问题描述 投票:1回答:1

我无法在我的Web应用程序机器人下载的机器人模板中找到Api控制器。应该在哪里“公共类MessagesController:ApiController”?

谢谢

botframework asp.net-apicontroller
1个回答
1
投票

V4中的编程模型是新的,不使用控制器。而是创建一个实现IBot的类,然后在启动期间使用惯用的.NET Core配置API进行注册。具体来说,你在services.AddBot<YourBot>(…)中调用ConfigureServices,然后在appBuilder.UseBotFramework()调用Configure

你可以从take a look at Startup.csthe "empty" bot in the samples看到这样的一个例子。

从那里I suggest reading the "How Bots Work" documentation for V4获得V4中核心概念的良好高级概述,例如转弯和转弯上下文。

© www.soinside.com 2019 - 2024. All rights reserved.