2021-11-23 22:56:22 +01:00
|
|
|
using Microsoft.AspNetCore.Hosting;
|
2021-11-25 15:38:36 +01:00
|
|
|
using Microsoft.Extensions.Configuration;
|
2021-11-23 22:56:22 +01:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2021-12-03 15:49:34 +01:00
|
|
|
using Microsoft.Extensions.Options;
|
2021-11-23 22:56:22 +01:00
|
|
|
|
|
|
|
|
namespace zero.FileStorage;
|
|
|
|
|
|
2022-01-06 18:10:58 +01:00
|
|
|
internal class ZeroFileStorageModule : ZeroModule
|
2021-11-23 22:56:22 +01:00
|
|
|
{
|
2021-11-30 14:32:10 +01:00
|
|
|
public override void ConfigureServices(IServiceCollection services, IConfiguration configuration)
|
2021-11-23 22:56:22 +01:00
|
|
|
{
|
2021-11-25 15:38:36 +01:00
|
|
|
services.AddScoped<IPaths>(factory => new Paths(factory.GetService<IWebHostEnvironment>()));
|
|
|
|
|
|
2021-11-30 14:32:10 +01:00
|
|
|
services.AddOptions<FileSystemOptions>().Bind(configuration.GetSection("Zero:FileSystem")).Configure(opts =>
|
2021-11-25 15:38:36 +01:00
|
|
|
{
|
|
|
|
|
opts.ZeroAssetsPath = "zero";
|
|
|
|
|
});
|
2021-11-23 22:56:22 +01:00
|
|
|
}
|
|
|
|
|
}
|