-
Notifications
You must be signed in to change notification settings - Fork 16
Update samples to minimal apis #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rido-min
merged 8 commits into
microsoft:main
from
rido-min:copilot/update-samples-to-minimal-apis
Jan 16, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
15cd0a3
Initial plan
Copilot 11bd990
Migrate samples from controller pattern to minimal APIs
Copilot 3d74579
Fix code review comments on MessageExtensions return types
Copilot 6235af3
remove swagger from echo
rido-min d460178
Merge branch 'main' into copilot/update-samples-to-minimal-apis
rido-min 245e65a
Merge branch 'main' into copilot/update-samples-to-minimal-apis
rido-min b87ed68
Merge branch 'main' into copilot/update-samples-to-minimal-apis
rido-min e4060ec
Merge branch 'main' into copilot/update-samples-to-minimal-apis
rido-min File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,39 +1,25 @@ | ||
| using Microsoft.Bot.Builder.Integration.AspNet.Core; | ||
| using Microsoft.Teams.Api.Activities; | ||
| using Microsoft.Teams.Apps; | ||
| using Microsoft.Teams.Apps.Activities; | ||
| using Microsoft.Teams.Apps.Annotations; | ||
| using Microsoft.Teams.Apps.Extensions; | ||
| using Microsoft.Teams.Plugins.AspNetCore.DevTools.Extensions; | ||
| using Microsoft.Teams.Plugins.AspNetCore.Extensions; | ||
|
|
||
| namespace Samples.BotBuilder; | ||
| using Samples.BotBuilder; | ||
|
|
||
| public static partial class Program | ||
| { | ||
| public static void Main(string[] args) | ||
| { | ||
| var builder = WebApplication.CreateBuilder(args); | ||
| builder.Services.AddTransient<Controller>(); | ||
| builder | ||
| .AddTeams() | ||
| .AddTeamsDevTools() | ||
| .AddBotBuilder<Bot, BotBuilderAdapter, ConfigurationBotFrameworkAuthentication>(); | ||
| var builder = WebApplication.CreateBuilder(args); | ||
| builder | ||
| .AddTeams() | ||
| .AddTeamsDevTools() | ||
| .AddBotBuilder<Bot, BotBuilderAdapter, ConfigurationBotFrameworkAuthentication>(); | ||
|
|
||
| var app = builder.Build(); | ||
|
|
||
| var app = builder.Build(); | ||
| var teams = app.UseTeams(); | ||
|
|
||
| app.UseTeams(); | ||
| app.Run(); | ||
| } | ||
| teams.OnMessage(async context => | ||
| { | ||
| await context.Typing(); | ||
| await context.Send("hi from teams..."); | ||
| }); | ||
|
|
||
| [TeamsController] | ||
| public class Controller | ||
| { | ||
| [Message] | ||
| public async Task OnMessage([Context] MessageActivity activity, [Context] IContext.Client client, [Context] Microsoft.Teams.Common.Logging.ILogger log) | ||
| { | ||
| await client.Typing(); | ||
| await client.Send($"hi from teams..."); | ||
| } | ||
| } | ||
| } | ||
| app.Run(); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The namespace directive was removed but the code references
Samples.BotBuilder.Bot(via the using statement at line 7). Ensure that the Bot class is defined in the Samples.BotBuilder namespace in another file, otherwise this will cause a compilation error.