protected virtual void RegisterDependencies(ContainerBuilder cb) { // Be careful of Captive Dependency cb.Register(cc => ShareQRDbContext.Create(cc.Resolve <IFileHelper>().GetSharedFilePath("ShareQR.db"))).As <ShareQRDbContext>().SingleInstance(); cb.RegisterType <QRCodeItemStore>().As <IQRCodeItemStore>().SingleInstance(); cb.RegisterType <MessageService>().As <IMessageService>(); }
protected ActionViewController(IntPtr handle) : base(handle) { // Note: this .ctor should not contain any initialization logic. _fileHelper = new FileHelper(); _db = ShareQRDbContext.Create(_fileHelper.GetSharedFilePath("ShareQR.db")); _qrCodeItemStore = new QRCodeItemStore(_fileHelper, _db); }