Exemplo n.º 1
0
        protected override void Load(ContainerBuilder builder)
        {
            builder.Register(c => EfCoreContextFactory.Create())
            .As <DbContext>()
            .AsImplementedInterfaces();

            builder.RegisterType <ContextAdapter>().AsImplementedInterfaces();
        }
Exemplo n.º 2
0
        protected override void Load(ContainerBuilder builder)
        {
            var context = EfCoreContextFactory.Create();

            builder.RegisterInstance(context)
            .As <DbContext>()
            .AsImplementedInterfaces()
            .AsSelf();
        }
Exemplo n.º 3
0
 public void RecreateContext()
 {
     Context.Dispose();
     Context = EfCoreContextFactory.Create();
 }