public MediaServiceConfiguration()
 {
     CoreConfig = BlobStorageConfig.GetConfig("./Resource/blobstorageconfig.json");
     WebConfig = WebConfig.GetWebConfig("./webconfig.json");
     MongoDbConfig mongoDbConfig = MongoDbConfig.GetMongoDbConfig("./Resource/mongodbconfig.json");
     ImageService = ImageServiceFactory.GetImageService(CoreConfig, mongoDbConfig);
 }
Exemple #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddOptions();
            // services.Configure<MediaServiceConfiguration>(Configuration);
            services.AddLogging(loggingBuilder =>
                                loggingBuilder.AddSerilog(dispose: true));

            BlobStorageConfig blobStorageConfig = BlobStorageConfig.GetConfig("./Resource/blobstorageconfig.json");
            FileStorageConfig fileStorageConfig = FileStorageConfig.GetConfig("./Resource/filestorageconfig.json");
            MongoDbConfig     mongoDbConfig     = MongoDbConfig.GetMongoDbConfig("./Resource/mongodbconfig.json");
            WebConfig         webConfig         = WebConfig.GetWebConfig("./webconfig.json");

            services.AddSingleton <IImageService, ImageService>(
                s => ImageServiceFactory.GetImageServiceCached(blobStorageConfig, fileStorageConfig, mongoDbConfig)
                );
            services.AddSingleton <WebConfig, WebConfig>(c => webConfig);

            services.AddMvc();
        }
Exemple #3
0
 public TestService(ITestOutputHelper output)
 {
     config      = BlobStorageConfig.GetConfig(@"C:\Users\t-chwang\source\repos\ImageServingPlatform\Core\Storage\blobstorageconfig.json");
     testFolder  = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\";
     this.output = output;
 }