示例#1
0
 private void ConfigureApplication()
 {
     PsychoCareContextInitializer.Initialize();
     ContainerHolder.RegisterCommonDependencies();
     ContainerHolder.Container.Register <IWebPrincipal, WebPrincipal>(Lifestyle.Scoped);
     ContainerHolder.Container.Verify();
 }
示例#2
0
        public static void RegisterBaseDependencies()
        {
            ResetConatiner();

            ContainerHolder.RegisterCommonDependencies();
            Container.Options.AllowOverridingRegistrations = true;

            var contextBuilderMock = new Mock <IDbContextBuilder>();

            contextBuilderMock.Setup(x => x.GetContext())
            .Returns(() => new TestPsychoCareContext());

            ContainerHolder.Container.Register(typeof(IDbContextBuilder), () => contextBuilderMock.Object, Lifestyle.Transient);
        }