public UnitOfWork(DotNetSurferDbContext dbContext, ICdnHandler cdnHandler) { this._dbContext = dbContext; this._topicRepository = new Lazy <ITopicRepository>(() => new TopicRepository(this._dbContext, cdnHandler)); this._articleRepository = new Lazy <IArticleRepository>(() => new ArticleRepository(this._dbContext, cdnHandler)); this._userRepository = new Lazy <IUserRepository>(() => new UserRepository(this._dbContext, cdnHandler)); this._announcementRepository = new Lazy <IAnnouncementRepository>(() => new AnnouncementRepository(this._dbContext)); this._featureRepository = new Lazy <IFeatureRepository>(() => new FeatureRepository(this._dbContext)); this._statusRepository = new Lazy <IStatusRepository>(() => new StatusRepository(this._dbContext)); }
static AzureBlobTestHelper() { string appsettingPath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\..\src\Worker\DotNetSurfer_Backend.API")); _configuration = new ConfigurationBuilder() .SetBasePath(appsettingPath) .AddJsonFile("appsettings.json") .Build(); string accountName = _configuration["Blob:AccountName"]; string accountKey = _configuration["Blob:AccountKey"]; _cdnHandler = new DotNetSurfer_Backend.Infrastructure.CDNs.AzureBlobHandler(accountName, accountKey); _fileName = "TEST"; }
public ArticleRepository(DotNetSurferDbContext dbContext, ICdnHandler cdnHandler) : base(dbContext) { this._cdnHandler = cdnHandler; }
public AzureBlobHandler_DeleteImageFromStorageAsync() { this._cdnHandler = AzureBlobTestHelper.GetAzureBlobHandler(); this._fileName = AzureBlobTestHelper.GetTestFileName(); }