Exemple #1
0
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            builder.Register(x =>
                             DbContextHelper.BuildDbContext <BlogDbContext>(
                                 x.ResolveKeyed <string>("MainDbConnectionString")));
            // .SingleInstance();

            builder.RegisterType <CreateBlogRequestValidator>()
            .As <IValidator <CreateBlogRequest> >();
            builder.RegisterType <UpdateBlogRequestValidator>()
            .As <IValidator <UpdateBlogRequest> >();
            builder.RegisterType <DeleteBlogRequestValidator>()
            .As <IValidator <DeleteBlogRequest> >();

            builder.RegisterType <BasicCrudInteractor>()
            .As <IAsyncUseCaseRequestHandler <CreateBlogRequest, CreateBlogResponse> >()
            .As <IAsyncUseCaseRequestHandler <RetrieveBlogsRequest, PaginatedItem <RetrieveBlogsResponse> > >()
            .As <IAsyncUseCaseRequestHandler <RetrieveBlogRequest, RetrieveBlogResponse> >()
            .As <IAsyncUseCaseRequestHandler <UpdateBlogRequest, UpdateBlogResponse> >()
            .As <IAsyncUseCaseRequestHandler <DeleteBlogRequest, DeleteBlogResponse> >();

            builder.RegisterType <GetBlogsByUserNameInteractor>()
            .AsSelf();
        }
Exemple #2
0
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            builder.Register(x =>
                             DbContextHelper.BuildDbContext <PostDbContext>(
                                 x.ResolveKeyed <string>("MainDbConnectionString")))
            .SingleInstance();

            builder.RegisterType <ListOutPostByBlogInteractor>()
            .AsSelf()
            .SingleInstance();

            builder.RegisterType <ListOutPostByBlogPresenter>()
            .AsSelf()
            .SingleInstance();
        }
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            // security context
            builder.RegisterType <SecurityContextProvider>()
            .As <ISecurityContext>()
            .As <ISecurityContextPrincipal>()
            .InstancePerLifetimeScope();

            builder.Register(x =>
                             DbContextHelper.BuildDbContext <IdentityServerDbContext>(
                                 x.ResolveKeyed <string>("MainDbConnectionString")))
            .SingleInstance();

            builder.RegisterType <UserRepository>()
            .AsImplementedInterfaces()
            .SingleInstance();
        }