forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SurveyModule.cs
22 lines (18 loc) · 988 Bytes
/
SurveyModule.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
namespace CreateNewConversationBot
{
using Autofac;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Dialogs.Internals;
using Microsoft.Bot.Builder.Internals.Fibers;
public class SurveyModule : Module
{
protected override void Load(ContainerBuilder builder)
{
base.Load(builder);
builder.RegisterType<CreateNewConversationDialog>().As<IDialog<object>>().InstancePerDependency();
builder.Register((c, p) => new SurveyDialog()).AsSelf().InstancePerDependency();
builder.RegisterType<SurveyScheduler>().Keyed<ISurveyScheduler>(FiberModule.Key_DoNotSerialize).AsImplementedInterfaces().SingleInstance();
builder.Register(c => new SurveyService(c.Resolve<ISurveyScheduler>(), c.Resolve<ResumptionCookie>())).Keyed<ISurveyService>(FiberModule.Key_DoNotSerialize).AsImplementedInterfaces().InstancePerMatchingLifetimeScope(DialogModule.LifetimeScopeTag);
}
}
}