microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
aamirj/umi

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

21lines · modecode

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