private static void RegisterTypes(IUnityContainer container) { RegisterFormHandlers(container); Policies policies = new Policies(new RaciB2CBicycleService(new Uri(ConfigurationManager.AppSettings["BicycleInsurance.ApiUrl"]))); container.RegisterInstance <IPolicies>(policies); BicyclePolicies bicyclePolicies = new BicyclePolicies(new RaciB2CBicycleService(new Uri(ConfigurationManager.AppSettings["BicycleInsurance.ApiUrl"]))); container.RegisterInstance <IBicyclePolicies>(bicyclePolicies); CoverOptions covers = new CoverOptions(new RaciB2CBicycleService(new Uri(ConfigurationManager.AppSettings["BicycleInsurance.ApiUrl"]))); container.RegisterInstance <ICoverOptions>(covers); ReferenceDatas referenceDatas = new ReferenceDatas(new RaciB2CBicycleService(new Uri(ConfigurationManager.AppSettings["BicycleInsurance.ApiUrl"]))); container.RegisterInstance <IReferenceDatas>(referenceDatas); IEmailService emailService = new SendGridEmailService ( ConfigurationManager.AppSettings["SendGrid.ApiKey"], ConfigurationManager.AppSettings["SendGrid.ConfirmationEmailTemplateId"], ConfigurationManager.AppSettings["SendGrid.QuoteSurveyEmailTemplateId"] ); container.RegisterInstance <IEmailService>(emailService); container.RegisterType <IReferenceDataService, ReferenceDataService>(new ContainerControlledLifetimeManager()); container.Configure <Interception>().SetDefaultInterceptorFor <ReferenceDataService>(new VirtualMethodInterceptor()); }
public async Task AfterCoverSelection(IDialogContext context, IAwaitable <CoverOptions> choice) { CoverOptions option = await choice; string message = $"Thank you for selecting '{option}', few more questions"; await context.PostAsync(message); PromptDialog.Choice( context: context, resume: AfterPropertyTypeSelection, options: Enum.GetValues(typeof(Ownership)).Cast <Ownership>().ToArray(), prompt: "Please tell about property type?", retry: "I didn't understand. Please try again."); }