protected IContentRepository GetRepository(string repositoryType) { if (repositoryType == "GitHub") { var repository = new GitHubContentRepositoryImpl( token: Environment.GetEnvironmentVariable("GithubToken"), productHeaderValue: "VirtoCommerce", ownerName: "VirtoCommerce", repositoryName: "test-repository", mainPath: _githubMainPath); return repository; } else if (repositoryType == "Database") { EnsureDatabaseInitialized(() => new DatabaseContentRepositoryImpl(DatabaseName)); return new DatabaseContentRepositoryImpl(DatabaseName, new EntityPrimaryKeyGeneratorInterceptor(), new AuditableInterceptor()); } else if (repositoryType == "FileSystem") { var repository = new FileSystemContentRepositoryImpl(TempPath); return repository; } throw new NullReferenceException(String.Format("{0} is not supported", repositoryType)); }
private FileSystemContentRepositoryImpl GetRepository() { var fullPath = string.Format("{0}\\Pages\\", _path); var repository = new FileSystemContentRepositoryImpl(fullPath); return repository; }