Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [BotAuthentication(CredentialProviderType = typeof(MultiCredentialProvider))]
- public class RouterController : ApiController
- {
- static readonly ILog Logger = LogManager.GetLogger("RouterController");
- public virtual async Task<HttpResponseMessage> Post([FromBody]Activity activity,
- CancellationToken token)
- {
- using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, activity))
- {
- var connector = scope.Resolve<IConnectorClient>();
- var botHandle = activity.GetBodHandle();
- //...
- }
- var response = Request.CreateResponse(HttpStatusCode.OK);
- return response;
- }
- }
- public class MultiCredentialProvider : ICredentialProvider {....}
- public static class Extensions
- {
- public static string GetBotHandle(this IMessageActivity activity)
- {
- return activity.Recipient.Id.Split('@').First();
- }
- }
Add Comment
Please, Sign In to add comment