Created
October 16, 2017 09:56
-
-
Save thangchung/3d3f82817064d2e8e4d1d2e65c50095f to your computer and use it in GitHub Desktop.
Applying clean architecture on web application with modular patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Autofac; | |
using BlogCore.Api.Features.Posts.ListOutPostByBlog; | |
using BlogCore.Infrastructure.EfCore; | |
using BlogCore.PostContext.Infrastructure; | |
using BlogCore.PostContext.UseCases.ListOutPostByBlog; | |
namespace BlogCore.PostContext | |
{ | |
public class PostUseCaseModule : Module | |
{ | |
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment