microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.0.0-preview.6

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Plugins/Microsoft.Teams.Plugins.AspNetCore.BotBuilder/RemoveDefaultMessageController.cs

16lines · modecode

1using Microsoft.AspNetCore.Mvc.ApplicationParts;
2using Microsoft.AspNetCore.Mvc.Controllers;
3using System.Reflection;
4
5public class RemoveDefaultMessageController : IApplicationFeatureProvider<ControllerFeature>
6{
7 public void PopulateFeature(IEnumerable<ApplicationPart> parts, ControllerFeature feature)
8 {
9 Type messageController = typeof(Microsoft.Teams.Plugins.AspNetCore.Controllers.MessageController);
10
11 List<TypeInfo> matches = feature.Controllers.Where(c => c.AsType() == messageController).ToList();
12 foreach (TypeInfo match in matches) {
13 feature.Controllers.Remove(match);
14 }
15 }
16}
17