예제 #1
0
        public static IServiceCollection RegisterEntityFrameworkStore(this IServiceCollection services, Action <DbContextOptionsBuilder> optionsAction)
        {
            services.AddStoresDbContext(optionsAction);

            services.AddScopedWithImplementation <IFileStore, EfFileStore>();

            FileStoreFactory.RegisterFileStore <EfFileStore>("ef", true);

            return(services);
        }
예제 #2
0
        public static IServiceCollection RegisterGitHubStore(this IServiceCollection services)
        {
            services.AddScoped <RepositoryIdCache>();

            services.AddScopedWithImplementation <IFileStore, GithubFileStore>();
            services.AddScopedWithImplementation <IRepositoryQuery, RepositoryQuery>();
            services.AddScopedWithImplementation <ISearchRepositoryQuery, SearchRepositoryQuery>();
            services.AddScopedWithImplementation <IBranchService, BranchService>();

            FileStoreFactory.RegisterFileStore <GithubFileStore>("git", false);

            return(services);
        }