-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e3e2c1
commit ec4e5a1
Showing
9 changed files
with
113 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 16 additions & 28 deletions
44
...pp-hello-world/csharp/Microsoft.Teams.Samples.HelloWorld.Web/Controllers/BotController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,36 @@ | ||
// <copyright file="BotController.cs" company="Microsoft Corporation"> | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// </copyright> | ||
|
||
// Licensed under the MIT License. | ||
// | ||
// Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.6.2 | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Bot.Builder; | ||
using Microsoft.Bot.Builder.Integration.AspNet.Core; | ||
|
||
namespace Microsoft.Teams.Samples.HelloWorld.Web.Controllers | ||
{ | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Bot.Builder; | ||
using Microsoft.Bot.Builder.Integration.AspNet.Core; | ||
|
||
/// <summary> | ||
/// This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot | ||
/// implementation at runtime. Multiple different IBot implementations running at different endpoints can be | ||
/// achieved by specifying a more specific type for the bot constructor argument. | ||
/// </summary> | ||
// This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot | ||
// implementation at runtime. Multiple different IBot implementations running at different endpoints can be | ||
// achieved by specifying a more specific type for the bot constructor argument. | ||
[Route("api/messages")] | ||
[ApiController] | ||
public class BotController : ControllerBase | ||
{ | ||
private readonly IBot bot; | ||
private readonly IBotFrameworkHttpAdapter adapter; | ||
private readonly IBotFrameworkHttpAdapter Adapter; | ||
private readonly IBot Bot; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="BotController"/> class. | ||
/// </summary> | ||
/// <param name="adapter">The bot framework HTTP adapter.</param> | ||
/// <param name="bot">The bot instance.</param> | ||
public BotController(IBotFrameworkHttpAdapter adapter, IBot bot) | ||
{ | ||
this.adapter = adapter; | ||
this.bot = bot; | ||
Adapter = adapter; | ||
Bot = bot; | ||
} | ||
|
||
/// <summary> | ||
/// Handles the HTTP POST request. | ||
/// </summary> | ||
/// <returns>A task that represents the work queued to execute.</returns> | ||
[HttpPost] | ||
public async Task PostAsync() | ||
{ | ||
// Delegate the processing of the HTTP POST to the adapter. | ||
// The adapter will invoke the bot. | ||
await this.adapter.ProcessAsync(this.Request, this.Response, this.bot); | ||
await Adapter.ProcessAsync(Request, Response, Bot); | ||
} | ||
} | ||
} | ||
} |
44 changes: 10 additions & 34 deletions
44
...p-hello-world/csharp/Microsoft.Teams.Samples.HelloWorld.Web/Controllers/HomeController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,41 @@ | ||
// <copyright file="HomeController.cs" company="Microsoft Corporation"> | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// </copyright> | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Microsoft.Teams.Samples.HelloWorld.Web.Controllers | ||
{ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
/// <summary> | ||
/// HomeController class to handle web requests for the home page and other routes. | ||
/// </summary> | ||
[Route("")] | ||
public class HomeController : Controller | ||
{ | ||
/// <summary> | ||
/// Handles the default route and returns the Index view. | ||
/// </summary> | ||
/// <returns>The Index view.</returns> | ||
[Route("")] | ||
public ActionResult Index() | ||
{ | ||
return this.View(); | ||
return View(); | ||
} | ||
|
||
/// <summary> | ||
/// Handles the /hello route and returns the Index view. | ||
/// </summary> | ||
/// <returns>The Index view.</returns> | ||
[Route("hello")] | ||
public ActionResult Hello() | ||
{ | ||
return this.View("Index"); | ||
return View("Index"); | ||
} | ||
|
||
/// <summary> | ||
/// Handles the /first route and returns the First view. | ||
/// </summary> | ||
/// <returns>The First view.</returns> | ||
[Route("first")] | ||
public ActionResult First() | ||
{ | ||
return this.View(); | ||
return View(); | ||
} | ||
|
||
/// <summary> | ||
/// Handles the /second route and returns the Second view. | ||
/// </summary> | ||
/// <returns>The Second view.</returns> | ||
[Route("second")] | ||
public ActionResult Second() | ||
{ | ||
return this.View(); | ||
return View(); | ||
} | ||
|
||
/// <summary> | ||
/// Handles the /configure route and returns the Configure view. | ||
/// </summary> | ||
/// <returns>The Configure view.</returns> | ||
[Route("configure")] | ||
public ActionResult Configure() | ||
{ | ||
return this.View(); | ||
return View(); | ||
} | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
samples/app-hello-world/csharp/Microsoft.Teams.Samples.HelloWorld.Web/GlobalSuppressions.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.