コード例 #1
0
 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));
 }
コード例 #2
0
        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";
        }
コード例 #3
0
 public ArticleRepository(DotNetSurferDbContext dbContext, ICdnHandler cdnHandler)
     : base(dbContext)
 {
     this._cdnHandler = cdnHandler;
 }
コード例 #4
0
 public AzureBlobHandler_DeleteImageFromStorageAsync()
 {
     this._cdnHandler = AzureBlobTestHelper.GetAzureBlobHandler();
     this._fileName   = AzureBlobTestHelper.GetTestFileName();
 }